httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: Segfaults restarting on Linux with worker MPM
Date Wed, 17 Apr 2002 14:54:55 GMT
Aaron Bannert <> writes:

> On Tue, Apr 16, 2002 at 02:16:59PM -0700, Justin Erenkrantz wrote:
> > Why are we cleaning up pchild before its threads exit?  Shouldn't
> > we be doing a join on each thread - only after all threads exit
> > do we exit the process and clean up pchild?
> Because right now there is no way to gracelessly kill a thread that is
> busy serving a long request.
> Does this mean that we need to check a "workers_may_exit"-like flag
> every time a syscall falls out with EINTR? This is kind of a problem,
> since we've decided to disallow pthread_kill-like functionality in
> APR (for good reason perhaps).

We'd do pthread_cancel() to catch the pthread calls which won't
return EINTR but are cancellation points, and we'd do pthread_kill()
to catch the non-pthread calls which return EINTR but aren't
cancellation points?  But there are pthread functions (e.g.,
pthread_mutex_lock()) which won't return EINTR and are not cancellation
points.  I guess at that point you assume that the thread owning the
mutex will hit a cancellation point or get the signal and then release
the mutex so that a thread blocked in pthread_mutex_lock() can reach
such a state.  But for this you need to try the pthread_kill()
multiple times to make up for the fact that some will be eaten while
the thread is blocked in pthread_mutex_lock().  Or maybe the signal
handler sets a per-thread variable that Apache and APR can reference

(I would interpret this as "I have no clue how to practically and
cleanly implement graceless termination.")

Jeff Trawick |
Born in Roswell... married an alien...

View raw message