Mailing List Archive

[Bug 66463] New: Socket Stuck on: proxy_fcgi:error (104)Connection reset by peer:
https://bz.apache.org/bugzilla/show_bug.cgi?id=66463

Bug ID: 66463
Summary: Socket Stuck on: proxy_fcgi:error (104)Connection
reset by peer:
Product: Apache httpd-2
Version: 2.4.55
Hardware: PC
OS: Linux
Status: NEW
Severity: critical
Priority: P2
Component: mod_http2
Assignee: bugs@httpd.apache.org
Reporter: lg@efficientip.com
Target Milestone: ---

Hello

Since the upgrade to httpd 2.4.55 when I restart the my backend ( php-fpm )
The connection stays open instead of being closed.


To test it I use this Configuration :

---- httpd.conf ----

Listen 443

LoadModule mpm_event_module modules/mod_mpm_event.so

LoadModule http2_module modules/mod_http2.so
Protocols h2 h2c http/1.1

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
LoadModule ssl_module modules/mod_ssl.so

DirectoryIndex index.php index.html
<FilesMatch \.php$>
# SetHandler "proxy:unix:/run/php-fpm/php-fpm.sock|fcgi://localhost/"
SetHandler "proxy:unix:/run/php-fpm-legacy/php-fpm.sock|fcgi://localhost/"
</FilesMatch>
<Proxy "fcgi://localhost" enablereuse=off flushpackets=on timeout=300>
</Proxy>

<VirtualHost *:443>
DocumentRoot /srv/http
SSLEngine on
SSLHonorCipherOrder off
SSLCertificateFile /data/ssl/host.crt
SSLCertificateKeyFile /data/ssl/host.key
SSLOpenSSLConfCmd DHParameters /data1/ssl/dhparams.pem
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
</VirtualHost>

----




My simple HTML code :
----- index.html ----
<html>
<body>
<h1>SSE demo with PHP</h1>

<ol id="list">
</ol>

<script>
// Create new event, the server script is sse.php
var eventSource = new EventSource("sse.php");

// Event when receiving a message from the server
eventSource.onmessage = function(event) {
// Append the message to the ordered list
document.getElementById("list").innerHTML += '<li>'+event.data + "</li>";
};
</script>

</body>
</html>
------------

The PHP code :
------ sse.php -----
<?php

ini_set('session.use_cookies',false);
session_cache_limiter(false);
session_start();

header("Content-Type: text/event-stream");
header("Cache-Control: no-cache");
header("Access-Control-Allow-Origin: *");

function sendMsg($id, $msg) {
echo "id: $id" . PHP_EOL;
echo "data: $msg" . PHP_EOL;
echo PHP_EOL;
ob_flush();
flush();
}

while (1) {
$serverTime = time();
sendMsg($serverTime, 'server time: ' . date("h:i:s", time()));
sleep(1);
}
------------------


I Just have to go on the /index.html and restart php-fpm to have the issue.

And if I remove the module http2 by commenting these 2 lines
#LoadModule http2_module modules/mod_http2.so
#Protocols h2 h2c http/1.1

Everything is Working.

----- httpd -V ----
Server version: Apache/2.4.55 (Unix)
Server built: Jan 18 2023 19:03:59
Server's Module Magic Number: 20120211:126
Server loaded: APR 1.7.0, APR-UTIL 1.6.1, PCRE 10.41 2022-12-06
Compiled using: APR 1.7.0, APR-UTIL 1.6.1, PCRE 10.40 2022-04-14
Architecture: 64-bit
Server MPM: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_PROC_PTHREAD_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/bin/suexec"
-D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
--------

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org