-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 when closing the http_listener #13
Comments
I suspect this area of code is of interest:
It looks like if there's some exception that prevents this bit of code from running, then the circular reference isn't broken, causing the hang. |
From
I've managed to reproduce the issue by putting a breakpoint at |
I forgot to mention that I was running version 2.6 of the library. |
It seems a lot of the error handling code in the |
First off, thanks a bunch for this very detailed analysis. I'm going to look into reproducing the issue on my local machine. Please continue posting any further details you find out. |
One piece of information that might be useful in your analysis: The only way that the lambda in
could possibly not run is if |
Thanks for the update, but that isn't entirely accurate. There are several ways in which that lambda can't run correctly. First off, is that when I've seen an instance where the destructor of I've also found a case where |
In case you're having difficulty reproducing, I've got my client side set to a 1 second timeout, and I'm just strategically putting in breakpoints in the cpprest library server-side, waiting for the client to time out the request, and then resuming the server. Key breakpoint places that cause issues so far include:
Additionally, forcing the client to send a malformed URL causes a similar failure. The function |
I'm currently in the process of drafting a patch for a pull request to hopefully resolve some/all of the issues I've identified, however there are some questions I'd like answered before continuing.
|
Additionally, I want to again say thanks for putting more eyes on this code. The |
I've pushed another change for review. I'm currently stress testing it as we speak. I found an answer as to why the library currently delays the response until the body download is complete. The I'm pretty sure there's still a race condition lurking, where if |
Can I get my pull request reviewed please? My boss is asking what the hold up is. Unless any issues are raised during the review, I think the pull request should be ready to merge. |
Alright, the pull request has been merged. Thanks for the ping reminder :) |
Chri7325/http helpers
Duplicated from CodePlex (issue 421) since the documentation says that issues should be reported to GitHub instead:
When calling http_listener.close().wait() as we're shutting down our service, the application will occasionally deadlock because the wait operation never returns. The deadlock appears to be in the http_windows_server::stop() function, there's a wait that never returns.
The text was updated successfully, but these errors were encountered: