posix-aio-cancellation · shipping · also aio_cancel

POSIX AIO cancellation

POSIX AIO cancellation attempts to stop requests associated with a submission descriptor, with individual outcomes recorded separately.

Related Observatory article: POSIX AIO cancellation on hesela.com

Batch result: AIO_NOTCANCELED means at least one targeted operation could not be canceled, not that none were canceled. AIO_ALLDONE reports completion without classifying success or failure. Inspect each original request with aio_error, then retrieve its return once with aio_return after termination. [1] [2]

Descriptor scope: glibc 2.39 groups requests by the submitted descriptor number. In the native control, canceling through a dup alias returned AIO_ALLDONE while the original descriptor's read remained pending. Shared open-file-description identity did not widen that lookup. [5] [7]

Lifetime: an expired aio_suspend wait does not cancel the request. A pending read still requires a valid control block and destination buffer; a shutdown path must account for the original operations and any notification activity. [4] [3]

Relations

related
I/O timeout, io_uring cancellation, Open file description

Limitations

  • Which operations can be canceled is implementation-defined.
  • Logical file readback does not establish crash durability or rollback of earlier effects.

Citations

  1. POSIX.1-2024: aio_cancel, cancellation scope and batch return values. (accessed 2026-11-13)
  2. POSIX.1-2024: aio_return, terminal status and one-time retrieval. (accessed 2026-11-13)
  3. POSIX.1-2024: aio_read, control-block and buffer lifetime. (accessed 2026-11-13)
  4. POSIX.1-2024: aio_suspend, expired waits and EAGAIN. (accessed 2026-11-13)
  5. glibc-2.39: rt/aio_cancel.c, __aio_cancel and descriptor-number lookup. (accessed 2026-11-13)
  6. Hesela: six native POSIX AIO cancellation cases, observed results and environment. (accessed 2026-11-13)
  7. Hesela: POSIX AIO cancellation, frozen source, observations, tests and offline replay. (accessed 2026-11-13)

Further reading

  1. glibc-2.39: rt/aio_misc.c, helper allocation and request grouping. (accessed 2026-11-13)
Sources & caveats
  • Six scenarios, three repetitions per GCC setting (O0/O2), 36 recorded executions on one Linux 6.8/glibc 2.39-0ubuntu8.9 host. Replays check those observations, not a larger device population. [7]
  • The canceled file write was queued behind a pipe gate, not interrupted in hardware. The offline package includes raw observations, source hashes, verification code and a license. [8]

JSON: /data/terms/posix-aio-cancellation.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. POSIX AIO cancellation. Hesela. 2026-11-13. https://hesela.dev/terms/posix-aio-cancellation/