Welcome! Log In Create A New Profile

Advanced

[PATCH 1 of 1] Fix for Nginx hanging on systems without EPOLLRDHUP

Marcus Ball
March 03, 2022 02:12PM
# HG changeset patch
# User Marcus Ball<marcus.ball@live.com>
# Date 1646329482 18000
# Thu Mar 03 12:44:42 2022 -0500
# Node ID 395afc438f3ed064f78c6d8f1c3e5abe4d6294fc
# Parent a736a7a613ea6e182ff86fbadcb98bb0f8891c0b
Add missing `ngx_use_epoll_rdhup` condition.

This fixes an issue where Nginx hangs when a response exceeding
the page size is being sent from an upstream server with
fastcgi_buffering enabled (such as from PHP-FPM).

This issue occurs on systems which support epoll, but which
do not support EPOLLRDHUP, like Digital Ocean's App Platform.

diff -r a736a7a613ea -r 395afc438f3e src/os/unix/ngx_readv_chain.c
--- a/src/os/unix/ngx_readv_chain.c Tue Feb 08 17:35:27 2022 +0300
+++ b/src/os/unix/ngx_readv_chain.c Thu Mar 03 12:44:42 2022 -0500
@@ -55,7 +55,9 @@

#if (NGX_HAVE_EPOLLRDHUP)

- if (ngx_event_flags & NGX_USE_EPOLL_EVENT) {
+ if ((ngx_event_flags & NGX_USE_EPOLL_EVENT)
+ && ngx_use_epoll_rdhup)
+ {
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"readv: eof:%d, avail:%d",
rev->pending_eof, rev->available);
diff -r a736a7a613ea -r 395afc438f3e src/os/unix/ngx_recv.c
--- a/src/os/unix/ngx_recv.c Tue Feb 08 17:35:27 2022 +0300
+++ b/src/os/unix/ngx_recv.c Thu Mar 03 12:44:42 2022 -0500
@@ -52,7 +52,9 @@

#if (NGX_HAVE_EPOLLRDHUP)

- if (ngx_event_flags & NGX_USE_EPOLL_EVENT) {
+ if ((ngx_event_flags & NGX_USE_EPOLL_EVENT)
+ && ngx_use_epoll_rdhup)
+ {
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"recv: eof:%d, avail:%d",
rev->pending_eof, rev->available);

_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[PATCH 1 of 1] Fix for Nginx hanging on systems without EPOLLRDHUP

Marcus Ball 574 March 03, 2022 02:12PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 82
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready