Just upgraded to the latest version (4.5.10, from from 4.0.X) and I experience timeouts and hangs. I cannot revert to the 4.0.X version, since we have customer nugetr packages depening on SS > 4.5.8.
We are experiencing weird behaviour on JsonServiceClient which starts to hang after 5 calls. When I restart the process, the same happens. Note that this only happens when there is more than 1 machine invloved. When I run locally, everything works fine.
I managed to pinpoint the issue to ServiceClientBase.cs, where it calls into PclExport.Instance.GetRequestStream(client))
As soon as this hits, I need to stop the service and restart. But, after 5 consecutive calls, it is the same. Please advise how to fix this, since this will prevent me from a go-live at a customer.
When the JsonServiceClient hangs it usually means there’s a HttpWebResponse that’s not being disposed somewhere, this can silently happen when sending a POST/PUT request to a Request DTO that doesn’t have a IReturn interface as it will return a HttpWebResponse (since it doesn’t know the Response) which needs to be disposed. These APIs are obsolete so check your warnings to make sure you’re not using any deprecated Service Client APIs, if you are adding an IReturnVoid to the Request DTO will change it to use an API that disposes the Response.
If the issue persists can you create a small stand-alone repro we can run locally to see it.
@mythz KUDOS!
The IReturnVoid was missing and this caused the issue. Is there any way to enforcing this as a requirement? Any DTO used with a ServiceClient should require an IReturn* interface
Nothing built-in, but you could add some code that goes through each Request DTO in an AfterInitCallbacks that goes through Metadata.RequestTypes to check they each have an IReturn* interface.
In the next major v5 release well be removing these deprecated APIs so you’ll get a build error if using an API that silently returns a HttpWebResponse.