Open light-years-run opened 1 year ago
This seems like a classic case of artificial bounds on thread pool max thread size ends up causing a deadlock of some sort due to async keyword usage and the synchronous methods not actually being synchronous internally (somehow)..
i.e. something like this might be happening:
This is a basic async or distributed processing system issue that can occur when the interfaces to constrained systems don't have built-in support for providing back pressure to the callers. (which isn't easy to do or easy to use once accomplished)
This also might be exacerbated by #2160, but I'm not sure there's necessarily a lot the RestSharp developers should do in this area above and beyond #2160.
We've just noticed the same issue on .NET 4.8 with synchronous calls.
var response = _restClient.Get(request);
The thread just hangs and keeps chewing memory until it causes the instance to crash.
We have replaced it with the
var response = _restClient.ExecuteRequest(request);
and it works fine.
Not sure what's the difference internally but might worth to remove synchronous method specific overloads (if finding out the issue proves too complicated).
I suppose it has something to do with the thread synchronisation and would be great if we can use the async calls but this is a legacy app and refactoring is just not worth it.
Describe the bug I use request url in ThreadPool, min Threads set to 2,Max Threads set to 10,when i run my code , after ExecuteGet i got hang,nothing response happen
RestSharp version 110.2.0, Net Framwork version:4.7.1
To Reproduce here is my code
Stack trace Copy the full stack trace here if you get an exception.
Desktop (please complete the following information):
Additional context Add any other context about the problem here.