Closed
Description
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.
pplx::task<void> http_windows_server::stop()
{
// Shutdown request queue.
if(m_hRequestQueue != nullptr)
{
HttpShutdownRequestQueue(m_hRequestQueue);
m_receivingTask.wait();
// Wait for all requests to be finished processing.
m_zeroOutstandingRequests.wait(); // Deadlock appears to be here
HttpCloseRequestQueue(m_hRequestQueue);
}