Server keeps watching old local plugin trees after a config path swap
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- backend
Rechercherichtung
Start with packages/core/src/plugin/module.ts, packages/core/src/config/plugin/source.ts, and packages/core/src/filesystem/watcher.ts to understand watch ownership and shared subscriptions. Reproduce the config-path swap, then add a regression test that directly counts active JS streams. Done means obsolete source paths are unsubscribed after reconciliation, while shared helpers and recoverable configured sources remain watched.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Changing plugins from one local source tree to another activates the replacement, but the running server keeps the old tree's file-watcher streams until the owning project location closes. Repeated swaps to new paths add more retained streams. Returning to a previously seen path does not add a second set for that path.
How to reproduce: Configure a local plugin outside the config discovery directories. Give it an entrypoint that imports a local helper. Copy the tree to a second path, then change plugins to point to the copy without restarting the server. Wait for the replacement to become active. Check for active streams under both trees, or check for watcher stopped records for the old tree after settling. Repeat with a third path. The old tree should stop being watched unless another active plugin needs one of its files.
What we measured: On a Linux service based on 2.4.2, with 12 local plugins across 20 loaded project directories, each tree generated 4,480 in-process subscribe requests across 224 watched paths. The first swap left all 224 outgoing native watch resources active; they stopped only at service shutdown. The patched build released all 224 outgoing paths on each of three swaps. Equivalent consumers already share native watch resources; 4,480 is a count of JS subscribe requests, not a kernel watch count or a direct census of live JS objects. A smaller regression test counted active JS streams directly and found the old root, entrypoint and helper still subscribed before the fix.
Source: The path is present on dev at e1d864a24dec1507160e430597eae53487358c21. PluginModule.watch forks each source-file stream into the supervisor's scope and never removes its path from watched. watchConfiguredSources does the same for configured roots. The watcher shares an underlying resource but adds a PubSub subscription for each consuming stream.
Proposed fix: Track watch fibers by path. After reconciliation, stop the streams and drop the source records no longer needed by any active or recoverable failed local source. Keep shared helpers watched, and reconcile configured root watches separately so manifest edits still work. This also covers the stale-watch lifetime noted in #62894 for missing imports, without removing automatic recovery for a still-configured source. We can share the patch and regression test.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 230k
- Forks
- 31.3k
- Ø Merge
- 5 Std. 32 Min.
- Gemergte PRs (30 T.)
- 453
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus anomalyco/opencode
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
anomalyco/opencode#67064 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 82/100
anomalyco/opencode#67009 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
area/web type/feature version/v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
anomalyco/opencode#67001 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any logEvtl. vergeben @liwenjie200543 hat das vor 2 Tagen übernommen. Offenarea/plugins platform/linux reproduced type/bug version/v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
anomalyco/opencode#66970 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaksEvtl. vergeben @argszero hat das vor 2 Tagen übernommen. Offenarea/tui platform/wsl status/repro-simulated type/bug version/v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
anomalyco/opencode#66773 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in anomalyco/opencode
Ähnliche Issues
-
enhancement feature/signals self-driving team/self-driving
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
PostHog/posthog#144208 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue web
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
triage: not actionable
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
oxc-project/oxc#30518 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug Claude useability
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
wazuh/wazuh-dashboard-plugins#9751 ·
Maintainer antworten meist innerhalb von 1 Tag