Mercurial > hg > nginx
annotate auto/types/value @ 7974:555533169506
HTTP/2: fixed "task already active" with sendfile in threads.
With sendfile in threads, "task already active" alerts might appear in logs
if a write event happens on the main HTTP/2 connection, triggering a sendfile
in threads while another thread operation is already running. Observed
with "aio threads; aio_write on; sendfile on;" and with thread event handlers
modified to post a write event to the main HTTP/2 connection (though can
happen without any modifications).
Similarly, sendfile() with AIO preloading on FreeBSD can trigger duplicate
aio operation, resulting in "second aio post" alerts. This is, however,
harder to reproduce, especially on modern FreeBSD systems, since sendfile()
usually does not return EBUSY.
Fix is to avoid starting a sendfile operation if other thread operation
is active by checking r->aio in the thread handler (and, similarly, in
aio preload handler). The added check also makes duplicate calls protection
redundant, so it is removed.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 25 Nov 2021 22:02:05 +0300 |
parents | d620f497c50f |
children |
rev | line source |
---|---|
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
370
diff
changeset
|
1 |
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
370
diff
changeset
|
2 # Copyright (C) Igor Sysoev |
4412 | 3 # Copyright (C) Nginx, Inc. |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
370
diff
changeset
|
4 |
361
446782c909b3
nginx-0.0.7-2004-06-20-23:54:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
5 |
446782c909b3
nginx-0.0.7-2004-06-20-23:54:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
6 cat << END >> $NGX_AUTO_CONFIG_H |
446782c909b3
nginx-0.0.7-2004-06-20-23:54:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
7 |
370
54f76b0b8dca
nginx-0.0.7-2004-06-27-22:01:57 import
Igor Sysoev <igor@sysoev.ru>
parents:
361
diff
changeset
|
8 #ifndef $ngx_param |
54f76b0b8dca
nginx-0.0.7-2004-06-27-22:01:57 import
Igor Sysoev <igor@sysoev.ru>
parents:
361
diff
changeset
|
9 #define $ngx_param $ngx_value |
361
446782c909b3
nginx-0.0.7-2004-06-20-23:54:15 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 #endif |
473 | 11 |
12 END |