Bug 68873

Summary: Threads with status endless "Closing Connection"
Product: Apache httpd-2 Reporter: Benoit <abonetevasion>
Component: mpm_eventAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED FIXED    
Severity: major    
Priority: P2    
Version: 2.4.59   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: Example, endless Closing Connection. Screenshot of my server-status with a status "C" (closing connection)

Description Benoit 2024-04-08 13:52:51 UTC
Created attachment 39654 [details]
Example, endless Closing Connection. Screenshot of my server-status with a status "C" (closing connection)

Hello,

For several weeks, my Apache server regularly consumes a lot of CPU.
In fact, thanks to server-status, after restarting httpd, after a few hours I notice that threads remain blocked endlessly with the status "Closing connection" (see my screenshot).
The problem is that these endless "Closing connections" take 100% of CPU, and this forces me to restart Apache regularly.

For me, this looks like an infinite loop that prevents the connection from closing.
Unfortunately I don't know how to reproduce this bug, the server-status doesn't give any more information, and I therefore don't know how to resolve this bug.

Has anyone ever encountered a similar situation and could offer me a solution?
Perhaps there is a directive to "kill" a thread in "Closing connection"?

For information, I am running Centos 7 with httpd 2.4.59 (compiled with mpm event).
Comment 1 Benoit 2024-04-30 09:30:58 UTC
Finally, I solved my problem on my own.
The cause came from a PHP script that had an infinite loop.

I figured it out after deactivating the H2 protocol, otherwise in the status I only saw "idle, stream" or "done, streams", and that didn't allow me to understand which page was blocking the server.
It's a shame that this H2 protocol hides the page that is still loading.