Skip to content

io_uring: recvCancelPending stays true when the pause's cancel misses, so the flag no longer describes the window #596

Description

@FumingPower3925

Found while measuring celeris#586 (branch measure/586-double-arm-counters): the review-specified witness RecvResumeWhileCancelPending over-counted the resume-during-cancel window ~1000× (10 993 vs 1 real entries at BP=8). Cause: cs.recvCancelPending is never cleared when the pause's ASYNC_CANCEL misses (the recv completes with data before the cancel runs; handleRecv's data path skips the re-arm while recvPaused and does not touch the flag; the cancel's own −ENOENT CQE is tagged udProvide and dropped), so the flag stays stale-true until some later −ECANCELED.

Behaviourally harmless today (the next pause sets it again and no other −ECANCELED reaches that branch), but a stale state flag on the recv path is the kind of bookkeeping #484 was. Fix: clear recvCancelPending on the miss path (when the paused recv completes with data, and on the cancel's −ENOENT), and keep the narrow witness RecvResumeWhileRecvInFlight (resume with recvCancelPending && recvArmed) the measurement added as the counter that names the window.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingengine/iouringio_uring engine specifics

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions