aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2024-01-29 10:31:37 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2024-01-29 10:31:37 +0300
commitb794465178ecf48f13b37e4397145b05fd3fe6df (patch)
treef35d2c58a628ba0559ed04c9fcdf6c9097396bb3 /src/os/unix
parentcc4c3ee0a45ca3a2eeac2874e9199bf42560015c (diff)
downloadnginx-b794465178ecf48f13b37e4397145b05fd3fe6df.tar.gz
nginx-b794465178ecf48f13b37e4397145b05fd3fe6df.zip
AIO operations now add timers (ticket #2162).
Each AIO (thread IO) operation being run is now accompanied with 1-minute timer. This timer prevents unexpected shutdown of the worker process while an AIO operation is running, and logs an alert if the operation is running for too long. This fixes "open socket left" alerts during worker processes shutdown due to pending AIO (or thread IO) operations while corresponding requests have no timers. In particular, such errors were observed while reading cache headers (ticket #2162), and with worker_shutdown_timeout.
Diffstat (limited to 'src/os/unix')
-rw-r--r--src/os/unix/ngx_files.c4
-rw-r--r--src/os/unix/ngx_linux_sendfile_chain.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/os/unix/ngx_files.c b/src/os/unix/ngx_files.c
index 1c82a8ead..2fec1ece1 100644
--- a/src/os/unix/ngx_files.c
+++ b/src/os/unix/ngx_files.c
@@ -110,6 +110,8 @@ ngx_thread_read(ngx_file_t *file, u_char *buf, size_t size, off_t offset,
return NGX_ERROR;
}
+ task->event.log = file->log;
+
file->thread_task = task;
}
@@ -493,6 +495,8 @@ ngx_thread_write_chain_to_file(ngx_file_t *file, ngx_chain_t *cl, off_t offset,
return NGX_ERROR;
}
+ task->event.log = file->log;
+
file->thread_task = task;
}
diff --git a/src/os/unix/ngx_linux_sendfile_chain.c b/src/os/unix/ngx_linux_sendfile_chain.c
index 101d91a9a..603f91722 100644
--- a/src/os/unix/ngx_linux_sendfile_chain.c
+++ b/src/os/unix/ngx_linux_sendfile_chain.c
@@ -332,6 +332,7 @@ ngx_linux_sendfile_thread(ngx_connection_t *c, ngx_buf_t *file, size_t size)
return NGX_ERROR;
}
+ task->event.log = c->log;
task->handler = ngx_linux_sendfile_thread_handler;
c->sendfile_task = task;