Repository navigation
h2 stream: the HTTP/2 deadlines and waits are stamped from internal/mono, which is still the wall clock: no value changes (Refs #1178) - #1186
Conversation
…ono, which is still the wall clock: no value changes (Refs #1178) Step 5 of the route-then-flip plan of #1178. The request deadline (ArmRequest), the header-block deadline, the write-stall records and the stage 3 waiter records and their judge (write_wait.go) take their stamps from mono.Now(); the waiters' timers are made of mono.Until(end), which replaces time.Until(time.Unix(0, end)): that read the WALL clock against a stamp of the loop's clock. The engines' loop-stuck stamps (LoopSlot.Enter) and the sweep's now, which the judge compares with its own reading, were routed with the engines. The fixtures of the stream and conn H2 sweep tests write mono.Now(). mono.Now() is the wall clock until the flip, so nothing changes. With this step every stamp of the component is routed but the one pending entry (Context.StartTime's time.Unix, the flip PR's), and the whole of internal/conn and internal/protocol/h2/stream passes with the clock skewed by +1 h and -1 h.
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Verification, docker linux/arm64
Benchmarks, main (b90c1cb) vs this PR (380eee5),
(ns/op; geometric mean +6.6%.) These are sub-100 ns benchmarks with 171 to 199 B/op on a busy shared host: the same binary varies by 40% between runs (OneByteGrant911/4MiB: this PR 46.9 to 78.8 ns, main 49.7 to 70.0 ns), and the |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Refs #1178
Step 5 of the route-then-flip plan. Value-neutral:
mono.Now()is still the wall clock. Stacked on main b90c1cb (#1185 merged).What changes
mono.Now(): the request deadline (ArmRequestat HEADERS), the header-block deadline (armHeaderBlock), the write-stall records (noteBuffered) and, from engines: an HTTP/2 pool handler's wait for the client's window is bounded as a minimum rate, not by an absolute deadline: stage 3 of the per-stream deadlines (v1.6.0, Refs #1170 #889) #1180, the waiter records and their judge (write_wait.go:beginWaitx2,judgeWait).mono.Until(ns)(new, =ns - Now()) makes the waiters' timers:time.Until(time.Unix(0, end))read the WALL clock against a stamp of the loop's clock, wrong by every step since the start of the process even with the stamp routed. It is the same value until the flip.H2State.Sweep(now)(the engines'now) against the stream stamps, and engines: an HTTP/2 pool handler's wait for the client's window is bounded as a minimum rate, not by an absolute deadline: stage 3 of the per-stream deadlines (v1.6.0, Refs #1170 #889) #1180'sLoopSlot.Enter(now)(the engines' batch start) againstjudgeWait's own reading.mono.Now(). The laststep 5pending entries and these fixtures are deleted. OnlyContext.StartTime'stime.Unixis still pending (step 6).internal/connandinternal/protocol/h2/streamat +1 h and -1 h. With steps 2 to 5 the whole stamp component is routed, so both pass skewed.Verified
internal/connandinternal/protocol/h2/streamwith the clock skewed by +1 h and -1 h: ok (7 to 8 s each). Plain: ok.internal/monoscan: 0 unlisted, 0 stale../test/server -run 1170(the pool-wait rate tests of engines: an HTTP/2 pool handler's wait for the client's window is bounded as a minimum rate, not by an absolute deadline: stage 3 of the per-stream deadlines (v1.6.0, Refs #1170 #889) #1180, engine + stream) plain and skewed, and benchmarks main vs this PR: in a comment.Draft: not marked ready, not merged.