fix(workspaces): recover from watcher startup failures - #2995
Closed
EivindKjosbakken wants to merge 1 commit into
Closed
EivindKjosbakken wants to merge 1 commit into
EivindKjosbakken wants to merge 1 commit into
Conversation
Contributor
Greptile SummaryThe PR makes workspace-registry recovery resilient to native watcher startup failures and exhausted worker restart budgets.
Confidence Score: 5/5The PR appears safe to merge, with watcher recovery, polling fallback, retry cleanup, and worker shutdown behavior remaining coherent. Failed watcher creations are released and retried through fresh resource-cache entries while polling continues independently, and indefinite worker supervision remains cancellable during shutdown.
|
| Filename | Overview |
|---|---|
| packages/core/src/runtimes/workspace-registry/node/scan/scheduler.ts | Adds guarded watcher readiness handling, bounded retry state, and complete timer cleanup without disrupting the independent polling floor. |
| packages/core/src/runtimes/workspace-registry/node/scan/scheduler.test.ts | Adds coverage for polling during watcher failure and event delivery after a failed watch is successfully reattached. |
| packages/core/src/runtimes/workspace-registry/node/worker-spec.ts | Replaces bounded default worker supervision with intentional indefinite on-failure retries capped at 30 seconds. |
| packages/core/src/runtimes/workspace-registry/node/worker-spec.test.ts | Verifies the worker鈥檚 restart policy, initial delay, and indefinitely repeated maximum delay. |
Sequence Diagram
sequenceDiagram
participant S as Scan Scheduler
participant W as Watch Service
participant P as Polling Floor
S->>W: watch(target)
W-->>S: ready() rejects
S->>W: release failed handle
S->>S: schedule bounded backoff
P->>S: request freshness scan
S->>W: retry watch(target)
W-->>S: ready() resolves
W-->>S: filesystem events resume
Reviews (1): Last reviewed commit: "fix(workspaces): recover from watcher st..." | Re-trigger Greptile
Collaborator
|
closing as resolved |
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.
Description
Recover the workspace registry when a native filesystem watcher cannot start.
Previously, a rejected
WatchHandle.ready()promise escaped as an unhandled rejection and terminated the workspace-registry worker. After the generic supervision budget was exhausted, new workspace activation stayed unavailable until the entire desktop app was restarted.This change:
Related issues
No existing issue found.
Testing
pnpm --filter @emdash/core run formatpnpm --filter @emdash/core run typecheckpnpm --filter @emdash/core run lintpnpm --filter @emdash/core exec vitest run --maxWorkers=1(203 files, 1,369 tests)pnpm run build(9 projects)Screenshot/Recording (if applicable)
Not applicable; this is worker recovery behavior.
Checklist