Cancelling aio operations on Linux

erankor nginx-forum at
Fri Sep 2 18:30:27 UTC 2016


Recently while reloading/restarting nginx I've been getting errors such as:
2016/09/02 11:13:44 [alert] 16480#16480: *1234 open socket #123 left in
connection 123

After setting `debug_points abort` and checking the core dump, I found that
all requests were blocked on file aio (they had r->blocked and r->aio both
set to 1)
I then looked at the nginx source and saw this comment:
 * FreeBSD file AIO features and quirks:
 *    aio_cancel() cannot cancel file AIO: it returns AIO_NOTCANCELED

My question is - from your knowledge, does aio_cancel work correctly on
Linux ?
If so, can you provide some high level guidance for implementing it ?

Btw, it is clear that there is some problem with the storage that makes aio
read operations hang forever, and cancelling them isn't the ideal solution,
but that will at least prevent them from having a cumulative negative effect
on the server.

Thank you !


Posted at Nginx Forum:,269366,269366#msg-269366

More information about the nginx mailing list