Harden VCS polling and CLI shutdown handling#3573
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Needs human review 2 blocking correctness issues found. This PR introduces new CLI shutdown handling, bounded child process spawning, significant VCS polling changes with new locking/caching mechanisms, and a major refactor of the event logging system. Two unresolved review comments identify potential bugs in the new caching and retention logic. These substantial behavioral changes warrant human review. You can customize Macroscope's approvability policy. Learn more. |
Summary
Testing
vp checkvp run typecheckvp run lintif available, otherwise not runNote
Harden VCS polling and CLI shutdown handling with bounded process spawning and LRU status cache
VcsStatusBroadcasternow maintains a bounded 128-entry LRU cache; entries are evicted when the last subscriber disconnects, and active pollers protect their entries from eviction.GitVcsDriverCoreserializes concurrent git fetches per shared object store, uses hardened--no-write-fetch-headfetch flags, backs off 30s on failure, and surfaces fetch errors via a newrefreshStatusUpstreamservice method onGitVcsDriverandGitWorkflowService.installNodeShutdownSignalEscalationinstalls SIGINT/SIGTERM handlers that force-exit with a conventional code on a second signal or after a 10s timeout; installed and cleaned up inbin.ts.BoundedChildProcessSpawnerwraps the existing spawner to send SIGTERM on scope close, escalate to SIGKILL aftertermGraceMs, and detach delegate finalizers so they don't block caller scope closure; activated viaBoundedChildProcessSpawner.layer()in the CLI runtime.EventNdjsonLogStorereplaces per-stream writers with a shared store supporting retention by age/size, oversized-record omission notices, and a configurable batch window (now 1000ms); native and canonical loggers share state inProviderEventLoggers.idleTtlMs: 0, tearing down immediately when it has no consumers.Macroscope summarized 4a4df05.