Bug 47635

Summary: Connections in Keep-Alive state keep accepting new requests after a graceful restart
Product: Apache httpd-2 Reporter: Sagi Bashari <apache>
Component: mpm_preforkAssignee: Apache HTTPD Bugs Mailing List <bugs>
Severity: normal CC: takashi.asfbugzilla
Priority: P2    
Version: 2.2.12   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Sagi Bashari 2009-08-04 04:09:33 UTC
I am using Apache 2.2.12 with the prefork MPM on Linux.

I am trying to send a graceful restart signal to the apply configuration changes without affecting currently processed requests. This works, but I found that the old configuration is still being applied on some new requests for some time after the graceful restart. After investigation, I found that the new requests are made on connections that were opened before the graceful restart was issued, and were kept alive.

It looks like after sending the graceful restart signal, a process that finishes handling the current request honors the client keep-alive request and lets him send more requests over the same connection. I believe that a better behavior would be to close the current connection as soon as it finishes handling the current request (as if MaxKeepAliveRequests was reached).

I took a look in the trunk source code and I think that the code in http_protocol.c attempts to do just that by not letting a connection to remain persistent if mpm_state == AP_MPMQ_STOPPING. However, it looks like the prefork MPM does not update the mpm_state of the child process after receiving a graceful restart signal, so maybe that's what should be fixed.
Comment 1 Eric Covener 2014-01-19 19:10:58 UTC

*** This bug has been marked as a duplicate of bug 41743 ***