comparison src/os/unix/ngx_linux_sendfile_chain.c @ 9202:e88cdaa0f1ff

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 29 Jan 2024 10:31:37 +0300
parents 555533169506
children
comparison
equal deleted inserted replaced
9201:791ead216b03 9202:e88cdaa0f1ff
330 task = ngx_thread_task_alloc(c->pool, sizeof(ngx_linux_sendfile_ctx_t)); 330 task = ngx_thread_task_alloc(c->pool, sizeof(ngx_linux_sendfile_ctx_t));
331 if (task == NULL) { 331 if (task == NULL) {
332 return NGX_ERROR; 332 return NGX_ERROR;
333 } 333 }
334 334
335 task->event.log = c->log;
335 task->handler = ngx_linux_sendfile_thread_handler; 336 task->handler = ngx_linux_sendfile_thread_handler;
336 337
337 c->sendfile_task = task; 338 c->sendfile_task = task;
338 } 339 }
339 340