Created attachment 32555 [details] Delay cgi requests made before the cgid daemon has started There is a short interval where httpd has started up and is accepting requests, but the cgid daemon has not yet created a listening socket. In this interval, any cgi requests made will receive a 503 response. While that response is technically correct, it seems like a retry system could be more appropriate.
Created attachment 32577 [details] Delay cgi requests made before the cgid daemon has started Rebased the patch onto trunk. Also made it not retry if the socket somehow goes away.
(In reply to Edward Lu from comment #1) > Rebased the patch onto trunk. Also made it not retry if the socket somehow > goes away. You probably need to save errno after connect() and use that value in late checks.
Created attachment 32578 [details] Delay cgi requests made before the cgid daemon has started Good point. The errno currently isn't being saved in trunk, but it's being used only in the log; I guess since we're using it for more in this patch, it's better to be safe.
Maybe declare connect_errno = 0 in the loop block so that it is initialized when connect() succeeds?
Created attachment 32579 [details] Delay cgi requests made before the cgid daemon has started Done.
Created attachment 32580 [details] Delay cgi requests made before the cgid daemon has started Forgot to take out a call to sleep I was using while testing. Sorry about all the revision spam.
Thanks Ed and Yann, committed with minor tweaks in r1667385
I encountered this problem with httpd 2.4.9, and tried the patch. Unfortunately, the 503 responses with the same "(2)No such file or directory: AH01257: unable to connect to cgi daemon after multiple tries" error also happen after a *graceful* restart of httpd. But the graceful restarts don't reset the scoreboard's restart_time, so if httpd has been running for more than a minute when the graceful restart occurs, we end up in the APLOGNO(02831) branch and don't benefit from any retries.
This has been merged in 2.4.x in r1669559. Is is part of 2.4.13