httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: worker MPM: close_worker_sockets race?
Date Thu, 22 Oct 2009 11:54:30 GMT
On Wed, Oct 21, 2009 at 9:08 PM, Bojan Smojver <bojan@rexursive.com> wrote:
> Looking at this function in worker.c:
> ----------------
> static void close_worker_sockets(void)
> {
>    int i;
>    for (i = 0; i < ap_threads_per_child; i++) {
>        if (worker_sockets[i]) {
>            apr_socket_close(worker_sockets[i]);
>            worker_sockets[i] = NULL;
>        }
>    }
> }
> ----------------
>
> Isn't there are possible race condition there, given that worker threads
> can also change worker_sockets[i] at the same time? Or are we suspending
> worker threads before this gets called?

I have long suspected that there is a race here, and that this code
should do shutdown for read and write rather than close in order to
avoid any possible funny business with descriptors.

Mime
View raw message