#1 2014-02-12 16:00:45

dorival
Member
From: Brasil
Registered: 2013-04-17
Posts: 35

Client driven instance not found or deprecated

Hi AB,

I'm running some stress tests between a server TSQLHttpServer and multiple clients TSQLHttpClient to make sure that I am correctly implementing the server and client.
I created an interface with two methods.
The first method is simpler, sends two integer values as parameter and returns the sum of these values. In this case not register connection issues.
The second method I use a DTO object as a parameter. In a few moments the error occurs: "Client driven instance not found or deprecated".

Is there anything can I do to prevent this error? Or this is due to excessive amount of requests that are sent at the same time?

Offline

#2 2014-02-12 16:27:18

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,273
Website

Re: Client driven instance not found or deprecated

Are you using the latest unstable version?

What is the InstanceCreation mode of the service?

Normally, you should not have this issue.

Offline

#3 2014-02-12 17:35:38

dorival
Member
From: Brasil
Registered: 2013-04-17
Posts: 35

Re: Client driven instance not found or deprecated

You're the guy ... I did update to the latest version. And the error occurs stopped ... Seems to have solved the problem. 
Sorry ... I should have done the update before asking.

By the way, the InstaceCreation:
- sicClientDriven on the server side
- sicSingle on the client side
This is the safest way to implement server and client?

Thanks AB.

Offline

#4 2014-02-12 19:22:48

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,273
Website

Re: Client driven instance not found or deprecated

Good to know.
The "unstable" version is almost always the.... more stable one!
smile

Note that the InstanceCreation MUST match on both client and server side.
Otherwise it won't work as expected (or not work I all, I suppose), since the contract will not be consistent.

Offline

#5 2014-02-13 11:16:13

dorival
Member
From: Brasil
Registered: 2013-04-17
Posts: 35

Re: Client driven instance not found or deprecated

Well, the error is still occurring. Now there are fewer errors than the previous version, but still occurs.
In my stress test I was testing an extreme situation. included a simple sleep (100) at the end of the loop and the error stopped occur.
As my application will not work in an extreme situation, I consider enough the tests.

by the way, in tests using InstaceCreation = sicClientDriven on the server side and on the client side sicSingle generates memory issue on the server. The memory usage grows as customers consume the services. InstaceCreation = sicClientDriven on both sides solve the problem.

Thanks for attention.

Offline

#6 2014-02-13 13:18:18

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,273
Website

Re: Client driven instance not found or deprecated

Could you provide the stack trace of the error?

And at least simple code to reproduce it?

Offline

#7 2014-02-13 16:36:14

dorival
Member
From: Brasil
Registered: 2013-04-17
Posts: 35

Re: Client driven instance not found or deprecated

course...

the project is very small... above the link to download de project:
http://www.sysmo.com.br/sysmo03/desenvo … r_http.rar

if you prefer just a snippet of code that I let'll post

trace of client:

...
20140213 14115619  +    TSQLHttpClientWinHTTP(02DAE910).auth
20140213 14115619  +    	TSQLHttpClientWinHTTP(02DAE910).00672725 
20140213 14115619 clnt  		TSQLHttpClientWinHTTP(02DAE910) GET root/auth?UserName=sysmo&Password=9bf7adb816db7d251deb9150606264e1ef90c5f3e5945acba8d57a1153f8674f&ClientNonce=d334ac28bec5d7c5f67a89dc512927afd4a82114c81b9d068c8a999df0ded328 status=200 state=0
20140213 14115619  -    	00.000.761
20140213 14115619 ret   	{"result":"195586981+07cd920dba2dff2bb14995d9900383c882cd388e8b04b0cd276a47559c0c96ea","logonname":"sysmo"}
20140213 14115619  -    00.000.818
20140213 14115619  +    TServiceFactoryClient(02E75690).ComunicacaoTeste._contract_
20140213 14115619  +    	TSQLHttpClientWinHTTP(02DAE910).00672725 
20140213 14115620 clnt  		TSQLHttpClientWinHTTP(02DAE910) POST root/ComunicacaoTeste._contract_?session_signature=0BA86BA5000BAA41BC3D62BD status=200 state=0
20140213 14115620  -    	00.000.592
20140213 14115620 ret   	{"result":{"contract":1}}
20140213 14115620  -    00.000.643
20140213 14115620  +    TServiceFactoryClient(02E75690).ComunicacaoTeste.SumInterface
20140213 14115620  +    	TSQLHttpClientWinHTTP(02DAE910).00672725 
20140213 14115620 clnt  		TSQLHttpClientWinHTTP(02DAE910) POST root/ComunicacaoTeste.SumInterface?session_signature=0BA86BA5000BAA41FD751CDD status=200 state=0
20140213 14115620  -    	00.001.282
20140213 14115620 ret   	{"result":{"Result":653},"id":14866}
20140213 14115620  -    00.001.329
20140213 14115620  +    TServiceFactoryClient(02E75690).ComunicacaoTeste.Inventario
20140213 14115620  +    	TSQLHttpClientWinHTTP(02DAE910).00672725 
20140213 14115620 clnt  		TSQLHttpClientWinHTTP(02DAE910) POST root/ComunicacaoTeste.Inventario/14866?session_signature=0BA86BA5000BAA41DF241A77 status=400 state=0
20140213 14115620  -    	00.000.930
20140213 14115620 ERROR 	TSQLHttpClientWinHTTP(02DAE910) POST root/ComunicacaoTeste.Inventario/14866 returned 400 Bad Request with message  {  "ErrorCode":400,  "ErrorText":"Client driven instance not found or deprecated"  } stack trace API 00609D0E 0064A804 0066EC3F 0066EAC8 006652C0 00665B76 
20140213 14115620  -    00.000.985
20140213 14115620 EXC   EInterfaceFactoryException ("Invalid fake IComunicacaoTeste.Inventario interface call: : {\r\n\"ErrorCode\":400,\r\n\"ErrorText\":\"Client driven instance not found or deprecated\"\r\n}") at 0066504A  stack trace 004C6B29 0040A132 767C339A 778E9EF2 778E9EC5 
20140213 14115621  +    TSQLHttpClientWinHTTP(02DAEB10).auth
20140213 14115621  +    	TSQLHttpClientWinHTTP(02DAEB10).TimeStamp
20140213 14115621  +    		TSQLHttpClientWinHTTP(02DAEB10).00672725 
20140213 14115621 clnt  			TSQLHttpClientWinHTTP(02DAEB10) GET root/TimeStamp status=200 state=0
20140213 14115621  -    		00.000.675
20140213 14115621 ret   		135163077367
20140213 14115621  -    	00.000.715
20140213 14115621  +    	TSQLHttpClientWinHTTP(02DAEB10).00672725 
20140213 14115621 clnt  		TSQLHttpClientWinHTTP(02DAEB10) GET root/auth?UserName=sysmo status=200 state=0
20140213 14115621  -    	00.000.463
20140213 14115621 ret   	{"result":"d334ac28bec5d7c5f67a89dc512927afd4a82114c81b9d068c8a999df0ded328"}
20140213 14115621  -    00.001.250
...

trace of server... consider only the ip 127.0.0.1

...
20140213 14115619 auth  	TAuthSession(02A6BAF0) New "User" session sysmo/195586981 created at 127.0.0.1/ED00000060000001 running Mozilla/4.0 (compatible; MSIE 5.5; Windows; Synopse mORMot 1.18 TWinHTTP)
20140213 14115619 srvr  	TServidorServicos(029ED170) GET auth -> 200
20140213 14115619  -    00.000.164
20140213 14115619  +    TServidorServicos(029ED170).root/auth?UserName=sysmo
20140213 14115619 call  	TServidorServicos(029ED170) Auth
20140213 14115619  +    TServidorServicos(029ED170).root/ComunicacaoTeste.Inventario/14863
20140213 14115619 srvr  	TServidorServicos(029ED170) GET auth -> 200
20140213 14115619  -    00.000.087
20140213 14115619  +    TServidorServicos(029ED170).root/ComunicacaoTeste.Inventario/14862
20140213 14115619 auth  	TSQLRestRoutingREST(03A72BE0) sysmo/TAuthSession(02A6C030)
20140213 14115619 call  	TServidorServicos(029ED170) ComunicacaoTeste.Inventario
20140213 14115619 auth  	TSQLRestRoutingREST(03A72EE0) sysmo/TAuthSession(02A6B970)
20140213 14115619 call  	TServidorServicos(029ED170) ComunicacaoTeste.Inventario
20140213 14115619  +    TServidorServicos(029ED170).root/ComunicacaoTeste.Inventario/14864
20140213 14115619 auth  	TSQLRestRoutingREST(03A72E60) sysmo/TAuthSession(02A6BBB0)
20140213 14115619 call  	TServidorServicos(029ED170) ComunicacaoTeste.Inventario
20140213 14115619  +    TServidorServicos(029ED170).root/ComunicacaoTeste.Inventario/14865
20140213 14115619 auth  	TSQLRestRoutingREST(03A72FE0) sysmo/TAuthSession(02A6BF70)
20140213 14115619 call  	TServidorServicos(029ED170) ComunicacaoTeste.Inventario
20140213 14115619  +    TServidorServicos(029ED170).root/ComunicacaoTeste._contract_
20140213 14115619 auth  	TSQLRestRoutingREST(03A729E0) sysmo/TAuthSession(02A6BAF0)
20140213 14115619 call  	TServidorServicos(029ED170) ComunicacaoTeste._contract_
20140213 14115619 srvr  	TServidorServicos(029ED170) POST ComunicacaoTeste._contract_ -> 200
20140213 14115619  -    00.000.075
20140213 14115620  +    TServidorServicos(029ED170).root/ComunicacaoTeste.SumInterface
20140213 14115620 auth  	TSQLRestRoutingREST(03A729E0) sysmo/TAuthSession(02A6BAF0)
20140213 14115620 call  	TServidorServicos(029ED170) ComunicacaoTeste.SumInterface
20140213 14115620 call  	TServiceFactoryServer(029BF6A0) Adding ComunicacaoTeste instance (id=14866)
20140213 14115620 srvr  	TServidorServicos(029ED170) POST ComunicacaoTeste.SumInterface -> 200
20140213 14115620  -    00.000.331
20140213 14115620  +    TServidorServicos(029ED170).root/auth?UserName=sysmo&Password=3dce52f73949785033111dbd6dc8216d8d2c1b06b0ba02ca0229a078f4502cf8&ClientNonce=d782580f356f26fad1750d718a394690f02348eb3c80f30f4425250f297c7b68
20140213 14115620 call  	TServidorServicos(029ED170) Auth
20140213 14115620 srvr  	TServidorServicos(029ED170) POST ComunicacaoTeste.Inventario -> 200
20140213 14115620  -    00.001.848
20140213 14115620 auth  	TAuthSession(02A6B730) New "User" session sysmo/195586980 created at 192.168.3.121/F30000006001008F running Mozilla/4.0 (compatible; MSIE 5.5; Windows; Synopse mORMot 1.18 TWinHTTP)
20140213 14115620 srvr  	TServidorServicos(029ED170) GET auth -> 200
20140213 14115620  -    00.000.221
20140213 14115620 srvr  	TServidorServicos(029ED170) POST ComunicacaoTeste.Inventario -> 200
20140213 14115620  -    00.001.948
20140213 14115620 call  	TServiceFactoryServer(029BF6A0) Deleted ComunicacaoTeste instance (id=14866) after -15 ms timeout (max 1800000 ms)
20140213 14115620  +    TServidorServicos(029ED170).root/ComunicacaoTeste.Inventario/14866
20140213 14115620 auth  	TSQLRestRoutingREST(03A72EE0) sysmo/TAuthSession(02A6BAF0)
20140213 14115620 call  	TServidorServicos(029ED170) ComunicacaoTeste.Inventario
20140213 14115620  +    TServidorServicos(029ED170).root/ComunicacaoTeste.Inventario/14860
20140213 14115620 auth  	TSQLRestRoutingREST(03A729E0) sysmo/TAuthSession(02A6C0F0)
20140213 14115620 call  	TServidorServicos(029ED170) ComunicacaoTeste.Inventario
20140213 14115620 srvr  	POST root/ComunicacaoTeste.Inventario/14866 ERROR=400 (Client driven instance not found or deprecated)
20140213 14115620  -    00.000.327
...

Offline

#8 2014-02-13 17:23:02

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,273
Website

Re: Client driven instance not found or deprecated

TServiceFactoryServer(029BF6A0) Deleted ComunicacaoTeste instance (id=14866) after -15 ms timeout (max 1800000 ms)

is pretty weird...

-15 ms timeout!

I'll investigate on this tomorrow!

Thanks for the feedback.

Offline

#9 2014-02-14 16:33:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,273
Website

Re: Client driven instance not found or deprecated

Framework will now use GetTickCount64() to fix any issue in case of GetTickCount() overflow.
Some "*: cardinal" properties are renamed "*64: Int64" for consistency.

I think we have also fixed a random concurrency problem as identified by your code.

See http://synopse.info/fossil/info/6c93405669

Thanks a lot for the feedback!
Hope it works as expected now on your side.
smile

Offline

#10 2014-02-14 18:56:57

dorival
Member
From: Brasil
Registered: 2013-04-17
Posts: 35

Re: Client driven instance not found or deprecated

I thanks a lot for your feedback!

I'm testing again (now without sleep(100)) and several workstations running the client application and so far no problem :-D

Grand week-end pour vous.

Offline

Board footer

Powered by FluxBB