https://issues.apache.org/bugzilla/show_bug.cgi?id=48094

           Summary: Avoid a race condition by suspending worker threads
                    before closing worker sockets
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: worker
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Created an attachment (id=24449)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24449)
(Hopefully) safe close_worker_sockets()

Current code closes worker sockets in close_worker_sockets() from the listener
thread without suspending the workers. At the same time, worker threads may be
in the process of doing the same (they may even set worker_sockets[i] to NULL,
causing a segfault in the listener), potentially causing problems.

The attached patch suspends worker threads first and then shuts down sockets,
using shutdown(). This way, worker threads can still proceed later with regular
close, without any side effects.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to