Repository navigation
mono: Context.StartTime reads internal/mono and the scan's pending lists are empty: no value changes (Refs #1178) - #1187
Merged
Merged
Conversation
…ts are gone (Refs #1178) Step 6 of the route-then-flip plan of #1178. Context.StartTime() returns mono.Time of the request's stamp: before the flip the same instant time.Unix(0, ns) gave, with a monotonic reading, so nothing changes. That was the last pending site: the pending and pendingFixtures tables are deleted, so the scan has one table, stays, with a reason for each of its entries, and a wall read that is not in it (a new one, or one re-added by a revert of a routing PR) fails TestNoWallStamps. TestNoWallFixtures refuses any test that writes a wall reading into a stamp field.
…under the skew canary (Refs #1178)
|
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1178
Step 6 of the route-then-flip plan: the scan is finished and its pending list is EMPTY. Value-neutral:
mono.Now()is still the wall clock. Stacked on main b4183a9 (#1186 merged).What changes
Context.StartTime()returnsmono.Time(startTimeNs)where it returnedtime.Unix(0, ns): the true wall instant of the request's stamp with a monotonic reading. Before the flip it is the same instant and the same value (the clock is the wall); after it,time.Since(c.StartTime())(the logger, metrics and otel latencies) ignores steps, and the logger's printed timestamp stays true wall time (the conversion subtracts the stamp's age from a freshtime.Now(), so it is right even if the clock drifted from the wall). This was the last pending entry.pendingandpendingFixturestables of the scan are deleted. The scan has ONE table,stays(8 sites: the Date header x2, a cookie'sExpires, two one-second flood windows, the router's promotion TTL, the two publicSetWSIdleDeadlinevalues of the websocket middleware), each with its reason. A wall read that is not in it (a new one, or one re-added by a revert of a routing PR) failsTestNoWallStamps; any test that writes a wall reading into a stamp field failsTestNoWallFixtures; the flip cherry-picked without its routing PRs fails the same way. The package documentation says so.TestStartTimeIsTheTrueWallTimeOfTheRequestsStamp1178(root) andBenchmarkStartTime1178. CI: the canary step runs the test at +1 h and -1 h next to the detach test. A mutant that goes back totime.Unix(0, ns)is killed by the canary at both signs (StartTime() is off by +1 h / -1 h) and by the scan.Verified
StartTimeIsTheTrueand the detach test at both signs on this tree: ok.middleware/loggerplain and skewed: ok.internal/mono: scan 0 unlisted, 0 stale,stays8 entries; 14 helper mutants and 11 scan mutants (step 1) still killed.Numbers (docker linux/arm64
--cpus 2, one container; this PR vs the same tree withtime.Unix(0, ns))StartTime()of an engine-stamped request: 1.48 ns -> 42.3 ns, once per request that asks for it (the logger, metrics, otel); 0 allocs.ContextAcquireRelease12.57 -> 12.95 ns and 18Unmatched852rows -0.8% to +7.3% (the routes do not callStartTime(): run-to-run noise of a shared host, the async rows ran last).Draft: not marked ready, not merged.