/[Apache-SVN]
ViewVC logotype

Revision 94031


Jump to revision: Previous Next
Author: trawick
Date: Wed Mar 20 03:54:25 2002 UTC (22 years, 2 months ago)
Changed paths: 3
Log Message:
Make the listener thread stop accepting new connections and exit
cleanly at graceful restart time.  This is a basic requirement of
reliable graceful restarts (the kind that won't drop connections).
This allows a future fix to make worker threads hang around until
they service all connections previously accepted by the listener
thread.

The old mechanism of doing a dummy connection to wake up the
listener thread in each old child process didn't work.  It didn't
guarantee that (in the main thread) the byte was read from the pod
and global variables were set before the listener thread grabbed
the connection.  It didn't guarantee that a child process in the
new generation didn't get some of the dummy connections.

Rather than burn extra syscalls adding a unique socket or pipe
to the poll set (and breaking single listen unserialized accept
in the same change), this uses a signal sent from the main thread
to the listener thread to break it out of the poll or accept.
(We don't worry about breaking it out of the optional mutex because
the child process holding the mutex will break out of poll/accept
and release the mutex, allowing a child blocked in the mutex to
get it.  Eventually all children blocked in the mutex will come
out.)

Since the listener thread now exits reliably, the main thread
joins it.

PR:
Obtained from:
Submitted by:
Reviewed by:


Changed paths

Path Details
Directoryhttpd/httpd/trunk/server/mpm/worker/pod.c modified , text changed , props changed
Directoryhttpd/httpd/trunk/server/mpm/worker/pod.h modified , text changed , props changed
Directoryhttpd/httpd/trunk/server/mpm/worker/worker.c modified , text changed , props changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26