apache2 fails to wait on stop/restart
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apache2 (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
Apache2 is failing to wait for all its threads to terminate when stopping. This leaves TCP ports still in use when apache2 tires to restart. This has been seen on Trusty and Xenial
This becomes a problems on restarts and stop/starts.
I have seen this running a simple loop with service apache2 restart. However this is inconsistent.
It happens more predictably when wsgi is involved even if stop and then start are used instead of restart:
* Stopping web server apache2
*
* Starting web server apache2
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
Hi David,
I tried reproducing this while triaging to confirm and set bug status.
In a trivial loop like:
for i in {1..100}; do echo $i; service apache2 restart; done;
It almost always blocks it by
Mar 31 11:09:34 xenial-tests systemd[1]: apache2.service: Start request repeated too quickly.
Mar 31 11:09:34 xenial-tests systemd[1]: Failed to start LSB: Apache2 web server.
I also installed wsgi and some other mods to slow down start/stop, but that didn't help either. mod-webauth libapache2- modsecurity)
(apt-get install libapache2-mod-wsgi libapache2-mod-nss libapache2-mod-scgi libapache2-
Installing these slows it down, so that systemd no more complains about it restarting too quickly, but it doesn't trigger the issue.
Did you something more to better trigger the issue in your tests?