fix(analytics): pump a stale collector latch from wall-clock enqueue - #6950
Open
yzxcj797 wants to merge 3 commits into
Open
fix(analytics): pump a stale collector latch from wall-clock enqueue#6950yzxcj797 wants to merge 3 commits into
yzxcj797 wants to merge 3 commits into
Conversation
|
@yzxcj797 is attempting to deploy a commit to the World Monitor Team on Vercel. A member of the Team first needs to authorize it. |
AbortSignal.timeout uses the same throttled scheduler as setTimeout, so moving the latch onto a retained native signal cannot pump a hidden-tab queue. The overflow enqueue is itself a JS turn; Date.now still advances there. Force-expire an in-flight write whose wall-clock age has already passed the 25s latch, then drain, before applying COLLECTOR_QUEUE_LIMIT. Keep the module-owned setTimeout for visible pages where timers still fire. Fixes koala73#6947 Fixes WORLDMONITOR-YD Co-authored-by: Elie Habib <koala73@users.noreply.github.com>
…ck pump The koala73#6947 pump test stayed green if .finally() skipped the epoch guard, because later fetches still resolved 200. Park the successor, assert calls === 2, and cover the compatibility, non-full, and all-critical overflow paths the review called out. Co-authored-by: Elie Habib <koala73@users.noreply.github.com>
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.
Summary
queue-overflowon WORLDMONITOR-YD survived the harden(analytics): the collector deadline is request-side, so a fetch wrapper that ignores abort still parks the serialized queue #6288 latch because Chromium intensive throttling can withhold a 25ssetTimeout(andAbortSignal.timeout, which uses the same scheduler) across an entire 60s health window. The queue is already full when the window opens and never drains, so the overflow write reportswriteCountwell below 50.Date.now()still advances. Enqueue now force-expires an in-flight write whose wall-clock age has already passed the 25s latch, then drains, before applyingCOLLECTOR_QUEUE_LIMIT.setTimeoutlatch for visible pages where timers still fire. Do not move the latch ontoAbortSignal.timeout— that is throttled the same way and cannot pump these windows.Fixes #6947
Fixes WORLDMONITOR-YD
Type of change
Affected areas
/api/*)Checklist
api/rss-proxy.jsallowlist (if adding feeds)npm run typecheck)expiresAtbounded to the first scheduled cron window (if applicable)Documentation Alignment Checklist
Not applicable: this changes collector transport behavior only and does not publish or change documentation claims.
Screenshots
Not applicable.