Skip to content

Clock-sync both sides of fetchHandler so handlerMs is real - #1676

Merged
RhysSullivan merged 1 commit into
mainfrom
diag/handler-clock-sync
Aug 18, 2026
Merged

Clock-sync both sides of fetchHandler so handlerMs is real#1676
RhysSullivan merged 1 commit into
mainfrom
diag/handler-clock-sync

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

First run of the cold/warm probe returned handlerMs: 0 on requests with 6002ms wall time — the same Date.now() pinning trap: a handler that performs no I/O leaves the clock frozen, so the delta reads 0 for work that took seconds.

Syncing with scheduler.wait(0) on both sides makes handlerMs a real duration, which finally splits the invocation cleanly into time inside Start versus time outside it.

It also already established that wasWarm is false on every request (13 cold, 0 warm), confirming every Start-handled request is the first in its isolate.

A handler that performs no I/O leaves Date.now() pinned, so the first run
reported handlerMs 0 against 6002ms wall. Sync before and after.
@RhysSullivan
RhysSullivan merged commit 2670c2b into main Aug 18, 2026
@RhysSullivan
RhysSullivan deleted the diag/handler-clock-sync branch August 18, 2026 22:26
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

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