You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Fiber A starts an operation.
Fiber B asks to cancel it and finishes.
Fiber A's operation completes by itself and fiber A finishes.
We try to end the loop, but get an error because the cancel operation hasn't yet been processed.
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.
The text was updated successfully, but these errors were encountered:
Normally, all operations should have finished by the time we exit
because we don't exit until all fibers have finished, and a fiber can't
finish while an operation is in progress. However, this is not the case
for cancellation operations, which may still be active in rare cases.
So drain any remaining CQEs at exit.
Other options here are to allow cancellation operations to block (which
they used to do, but that caused other problems), or to have the main
operation wait for its cancellation too (but that's tricky and affects
the fast-path).
Fixesocaml-multicore#467.
If a fiber raises an exception then the mainloop exits immediately.
This normally indicates a bug in Eio, since spawned fibers have
exception handlers that pass the error to the switch instead. However,
that wasn't the case for the root fiber.
If the root fiber raised an exception after submitting a cancel
operation then we would try to exit the ring too early, resulting in:
Invalid_argument("exit: 1 request(s) still active!")
Fixesocaml-multicore#467.
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:
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.The text was updated successfully, but these errors were encountered: