Follow-ups from the round-1 review of #807 (celeris#760), none blocking; the blocking one (a Shutdown ctx without a deadline got the 250 ms floor) is fixed in #807 itself.
- Bytes the shutdown drain sends are not counted.
drainSends flushes with onLoopThread=true (engine/epoll/loop.go, l.flushWrites(cs, true)), which adds to l.bytesWrittenBatch; that batch is moved into bytesWritten only in run(), which has returned by the time shutdown() runs. So the bytes the drain sends never reach Metrics().BytesWritten. Passing false (the atomic path) would count them.
- No test covers the cancel path's race. On a cancel of
StartWithContext's context the loops start draining before the watcher's Engine.Shutdown stores the budget; the drain re-reads it each 20 ms round, within the 250 ms floor. In TestShutdownSendsTheWholeResponse the handler holds the loop (sync) or asyncWG (async) for 200 ms after the cancel, so the budget is always stored before the drain starts. A drain that read the budget once at its start would pass. A test would release the handler before the watcher can run (or delay the watcher with a hook) and check the drain still extends to the budget.
(The review's third point, TestShutdownSendDrainIsBounded allowing budget + 5 s, is fixed in #807: the limit is budget + 1 s.)
Follow-ups from the round-1 review of #807 (celeris#760), none blocking; the blocking one (a
Shutdownctx without a deadline got the 250 ms floor) is fixed in #807 itself.drainSendsflushes withonLoopThread=true(engine/epoll/loop.go,l.flushWrites(cs, true)), which adds tol.bytesWrittenBatch; that batch is moved intobytesWrittenonly inrun(), which has returned by the timeshutdown()runs. So the bytes the drain sends never reachMetrics().BytesWritten. Passingfalse(the atomic path) would count them.StartWithContext's context the loops start draining before the watcher'sEngine.Shutdownstores the budget; the drain re-reads it each 20 ms round, within the 250 ms floor. InTestShutdownSendsTheWholeResponsethe handler holds the loop (sync) orasyncWG(async) for 200 ms after the cancel, so the budget is always stored before the drain starts. A drain that read the budget once at its start would pass. A test would release the handler before the watcher can run (or delay the watcher with a hook) and check the drain still extends to the budget.(The review's third point,
TestShutdownSendDrainIsBoundedallowing budget + 5 s, is fixed in #807: the limit is budget + 1 s.)