Mercurial > hg > nginx
annotate auto/lib/google-perftools/conf @ 8018:5119c8150478
Fixed runtime handling of systems without EPOLLRDHUP support.
In 7583:efd71d49bde0 (nginx 1.17.5) along with introduction of the
ioctl(FIONREAD) support proper handling of systems without EPOLLRDHUP
support in the kernel (but with EPOLLRDHUP in headers) was broken.
Before the change, rev->available was never set to 0 unless
ngx_use_epoll_rdhup was also set (that is, runtime test for EPOLLRDHUP
introduced in 6536:f7849bfb6d21 succeeded). After the change,
rev->available might reach 0 on systems without runtime EPOLLRDHUP
support, stopping further reading in ngx_readv_chain() and ngx_unix_recv().
And, if EOF happened to be already reported along with the last event,
it is not reported again by epoll_wait(), leading to connection hangs
and timeouts on such systems.
This affects Linux kernels before 2.6.17 if nginx was compiled
with newer headers, and, more importantly, emulation layers, such as
DigitalOcean's App Platform's / gVisor's epoll emulation layer.
Fix is to explicitly check ngx_use_epoll_rdhup before the corresponding
rev->pending_eof tests in ngx_readv_chain() and ngx_unix_recv().
author | Marcus Ball <marcus.ball@live.com> |
---|---|
date | Mon, 30 May 2022 02:38:07 +0300 |
parents | f7e79596baf2 |
children |
rev | line source |
---|---|
1949 | 1 |
2 # Copyright (C) Igor Sysoev | |
4412 | 3 # Copyright (C) Nginx, Inc. |
1949 | 4 |
5 | |
6 ngx_feature="Google perftools" | |
7 ngx_feature_name= | |
8 ngx_feature_run=no | |
9 ngx_feature_incs= | |
10 ngx_feature_path= | |
11 ngx_feature_libs="-lprofiler" | |
7327
f7e79596baf2
Configure: fixed compiler warnings with "-Wall -Wextra".
Sergey Kandaurov <pluknet@nginx.com>
parents:
5678
diff
changeset
|
12 ngx_feature_test="void ProfilerStop(void); |
f7e79596baf2
Configure: fixed compiler warnings with "-Wall -Wextra".
Sergey Kandaurov <pluknet@nginx.com>
parents:
5678
diff
changeset
|
13 ProfilerStop()" |
1949 | 14 . auto/feature |
15 | |
16 | |
17 if [ $ngx_found = no ]; then | |
18 | |
19 # FreeBSD port | |
20 | |
21 ngx_feature="Google perftools in /usr/local/" | |
22 | |
23 if [ $NGX_RPATH = YES ]; then | |
24 ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lprofiler" | |
25 else | |
26 ngx_feature_libs="-L/usr/local/lib -lprofiler" | |
27 fi | |
28 | |
29 . auto/feature | |
30 fi | |
31 | |
32 | |
4704
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
33 if [ $ngx_found = no ]; then |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
34 |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
35 # MacPorts |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
36 |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
37 ngx_feature="Google perftools in /opt/local/" |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
38 |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
39 if [ $NGX_RPATH = YES ]; then |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
40 ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lprofiler" |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
41 else |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
42 ngx_feature_libs="-L/opt/local/lib -lprofiler" |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
43 fi |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
44 |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
45 . auto/feature |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
46 fi |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
47 |
642755ee3fab
Added code to look up Google perftools in /opt/local/, for MacPorts.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
48 |
1949 | 49 if [ $ngx_found = yes ]; then |
50 CORE_LIBS="$CORE_LIBS $ngx_feature_libs" | |
2893
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
1949
diff
changeset
|
51 |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
1949
diff
changeset
|
52 else |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
1949
diff
changeset
|
53 |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
1949
diff
changeset
|
54 cat << END |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
1949
diff
changeset
|
55 |
5678 | 56 $0: error: the Google perftools module requires the Google perftools |
2893
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
1949
diff
changeset
|
57 library. You can either do not enable the module or install the library. |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
1949
diff
changeset
|
58 |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
1949
diff
changeset
|
59 END |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
1949
diff
changeset
|
60 |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
1949
diff
changeset
|
61 exit 1 |
1949 | 62 fi |