libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] MHD_stop_daemon occasionally locks on pthread_join


From: Christian Grothoff
Subject: Re: [libmicrohttpd] MHD_stop_daemon occasionally locks on pthread_join
Date: Wed, 30 Apr 2014 17:58:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10

That is certainly worrying, as MHD goes over all active connections on
destroy and calls 'shutdown' on them.  As a result,
poll() should not block on any of them and "instantly" return.

So the first thing I'd look at is what FDs the process still has
open (any?) at this time, and what 'poll' is exactly waiting on.
(Note that we use 'shutdown' in this phase instead of 'close' to avoid
races on the FDs with the application.)

Also, we did not make any changes to the code since 0.9.33 that
would 'fix' this kind of issue.

Happy hacking!

Christian

On 04/30/14 16:37, Lorenzo Miniero wrote:
> 
> What could be the cause? I guess that one of the threads serving the
> connections (MHD_USE_THREAD_PER_CONNECTION is used in my case) was still
> alive, but as I anticipated there's actually no request pending anymore,
> and all the tabs in the browser were closed as well, which should have
> closed the Ajax requests I use to contact the MHD-based server. What may
> be causing the poll to get stuck all that time, and how can I force it
> to unblock? EINTR can't be used as it is intercepted by the code, and a
> continue is issued without checking whether the webserver is closing or
> not. I'm using 0.9.33 by the way, not sure whether this was already
> fixed in 0.9.34 or not.
> 

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]