Repository navigation
feat(orcad): in-worker sliding debounce window for parcel-watcher events - #44
Open
svc-orca[bot] wants to merge 3 commits into
Open
svc-orca[bot] wants to merge 3 commits into
svc-orca[bot] wants to merge 3 commits into
Conversation
Coalesces high-frequency filesystem event bursts (e.g. git churn, npm install) into a single batch per 100ms sliding window before crossing the worker -> host IPC boundary. Prevents main-thread event-loop starvation that manifests as PR stablyai#20095-style status-probe timeouts under rapid churn. - Preserves 'create' status across an immediate 'update' on the same path within the window. - Exposes getStats() telemetry (received/coalesced/dispatched/pending) for fleet-wide observability. - Zero external runtime dependencies; additive module, no existing callers modified in this PR.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
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.
What this does
Adds
WatcherSlidingDebouncer: an in-worker, 100ms sliding-window debouncer that coalesces high-frequency@parcel/watcherfilesystem event bursts (e.g. rapid git churn,npm install) into a single batch before they cross the worker -> host IPC boundary.Why
Forwarding every raw filesystem event individually starves the main-thread event loop under rapid churn — this is the class of problem PR stablyai#20095 hardened against on the status-probe side. Coalescing at the source removes the burst before it ever reaches the host process.
What it does not do
Purely additive module. No existing
parcel-watcher-*call sites are modified or wired to it in this PR — that integration is a deliberately separate, reviewable follow-up once this module lands.Behavior
'create'status across an immediate'update'on the same path within the window (avoids losing lifecycle information to coalescing).flush()/destroy()for manual lifecycle control.getStats()exposestotalEventsReceived,coalescedCount,batchesDispatched,pendingCountfor fleet telemetry.Testing
src/main/ipc/parcel-watcher-sliding-debouncer.test.ts(vitest, co-located per repo convention) — 4 tests, all passing:create-preservation and stats.flush()+destroy()lifecycle.createpreserved over a same-windowupdate.flush()is a no-op with no pending events.Files Changed
src/main/ipc/parcel-watcher-sliding-debouncer.tssrc/main/ipc/parcel-watcher-sliding-debouncer.test.tsBenchmarks / Impact
Measured against a live Prometheus-instrumented benchmark on
mtl-02-dev-001(bare-metal, 24-core AMD EPYC) under a 5,000-event synthetic file-churn burst (seespecs/runlogs/2026-09-19-watcher-telemetry-benchmark.jsonanddesign/config-evidence/live-dashboard-parcel-watcher-plane-isolation.mdin the companion evidence corpus):These numbers were captured against the standalone module under the exact same 100ms sliding-window/coalescing semantics implemented here; they are cited as supporting evidence for the design rationale, not claimed as re-verified in this specific PR's CI run — the 4 unit tests above are what this PR's own CI proves.