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.
Found while measuring celeris#586 (branch
measure/586-double-arm-counters): the review-specified witnessRecvResumeWhileCancelPendingover-counted the resume-during-cancel window ~1000× (10 993 vs 1 real entries at BP=8). Cause:cs.recvCancelPendingis 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 whilerecvPausedand does not touch the flag; the cancel's own −ENOENT CQE is taggedudProvideand 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
recvCancelPendingon the miss path (when the paused recv completes with data, and on the cancel's −ENOENT), and keep the narrow witnessRecvResumeWhileRecvInFlight(resume withrecvCancelPending && recvArmed) the measurement added as the counter that names the window.