Skip to content

mono: Context.StartTime reads internal/mono and the scan's pending lists are empty: no value changes (Refs #1178) - #1187

Merged
FumingPower3925 merged 2 commits into
mainfrom
mono/1178-step6-push
Oct 31, 2026
Merged

FumingPower3925 merged 2 commits into
mainfrom
mono/1178-step6-push

Conversation

@FumingPower3925

Copy link
Copy Markdown
Contributor

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() returns mono.Time(startTimeNs) where it returned time.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 fresh time.Now(), so it is right even if the clock drifted from the wall). This was the last pending entry.
  • The pending and pendingFixtures tables of the scan are deleted. The scan has ONE table, stays (8 sites: the Date header x2, a cookie's Expires, two one-second flood windows, the router's promotion TTL, the two public SetWSIdleDeadline values 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) fails TestNoWallStamps; any test that writes a wall reading into a stamp field fails TestNoWallFixtures; the flip cherry-picked without its routing PRs fails the same way. The package documentation says so.
  • New test TestStartTimeIsTheTrueWallTimeOfTheRequestsStamp1178 (root) and BenchmarkStartTime1178. CI: the canary step runs the test at +1 h and -1 h next to the detach test. A mutant that goes back to time.Unix(0, ns) is killed by the canary at both signs (StartTime() is off by +1 h / -1 h) and by the scan.

Verified

  • Root package whole, no race, plain, +1 h and -1 h: ok (41 to 46 s each; run on the tree with every step applied). StartTimeIsTheTrue and the detach test at both signs on this tree: ok. middleware/logger plain and skewed: ok.
  • internal/mono: scan 0 unlisted, 0 stale, stays 8 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 with time.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. ContextAcquireRelease 12.57 -> 12.95 ns and 18 Unmatched852 rows -0.8% to +7.3% (the routes do not call StartTime(): run-to-run noise of a shared host, the async rows ran last).

Draft: not marked ready, not merged.

…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.
@FumingPower3925 FumingPower3925 added this to the v1.6.0 milestone Oct 31, 2026
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@FumingPower3925
FumingPower3925 marked this pull request as ready for review October 31, 2026 11:31
@FumingPower3925
FumingPower3925 merged commit 0b4d504 into main Oct 31, 2026
33 checks passed
@FumingPower3925
FumingPower3925 deleted the mono/1178-step6-push branch October 31, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant