-
-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deadlock with HTTP server and client in one process #277
Comments
I've updated my gist now to further figure out what is happening. In the new version, the server is running in a separate process and each I still see a deadlock sometimes on the client side. When that happens, the server is fine, and can be called just fine from another process. So this must be some bug (or error in my usage) of the HTTP client in libjson-rpc-cpp. |
According to my understanding,
HttpServer
creates multiple threads and listens with them detached from the main thread. And it should be possible to use multipleHttpClient
's with a single server and concurrently. Is that correct?I've created example code which starts a server and then does two "long" RPC calls from two separate threads to the server.
This sometimes (not always) results in a deadlock, where apparently only one of the calls is made and the other blocks before the server's method is called. In the example code, "Wait called" is then logged only once, and the code blocks until the
HttpClient
times out.Is this a bug or expected behaviour? If the latter, what exactly is my example code doing wrong? Thanks a lot!
The text was updated successfully, but these errors were encountered: