Skip to content

eio_linux: race cancelling jobs and exiting at the same time #467

@talex5

Description

@talex5

When the main loop exits, it checks that no uring operations are still in progress. Normally this will be the case because we don't allow a fiber to resume until its operation is complete, and the event loop doesn't exit until all fibers have done so.

However, cancel operations don't stop and wait. So I think this can happen:

  1. Fiber A starts an operation.
  2. Fiber B asks to cancel it and finishes.
  3. Fiber A's operation completes by itself and fiber A finishes.
  4. We try to end the loop, but get an error because the cancel operation hasn't yet been processed.

I think this is the cause of #466 (comment).

We should probably just wait for cancel operations to complete the same way we do for other operations.

This issue was previously hidden because the exception was reported using Log.warn, which silently drops messages by default. #465 changed this to raise an exception instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions