Skip to content

Settle pending plugin callers when their instance is disposed #5969

Closed

Description

@brsbl

Summary

Follow-up to #5964, intentionally deferred from #5967: settle or reject a disposed plugin instance's in-flight request continuations. Containing stale errors keeps the server alive, but does not stop abandoned work.

Versions and environment

Source baseline: 06ae8f039a7198a6aad2b9b6e030efb88f8dd923, Linux, Node 22 remote CI.

Steps to reproduce

Use the regression fixture in plugin-uncaught.test.ts. Its CLI handler awaits a gate; start the command, reload the plugin, then release the gate. The old handler continues and attempts a realtime publish.

Remote baseline reproduction: server test job.

Expected vs actual

Actual: disposal waits for the drain deadline, logs plugin uncaught: 1 in-flight invocation(s) did not settle before dispose; proceeding, and invalidates the handle. The caller/continuation can remain pending and resume after disposal.

Expected: define and implement how core settles pending callers at disposal and cooperatively cancels their work, preserving existing plugin contracts. JavaScript promises cannot forcibly cancel arbitrary plugin continuations; the design must explicitly cover that limit.

Evidence

What you ruled out

Acceptance criteria

  • Specify behavior for pending CLI, route and RPC callers on reload, disable, and removal.
  • Reuse invocation tracking and existing cancellation signals where possible.
  • Verify callers settle, fresh instances remain unaffected, and late continuations cannot mutate disposed resources.
  • Obtain approval before any shipped plugin API contract change.

AGENT GENERATED

Activity

  1. added theissue type on Oct 21, 2026
  2. added
    plugins
    on Oct 21, 2026
  3. bb-slop-cop commented on Oct 21, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied missing classifications: Type: Task · Priority: Medium · Effort: High · Labels: plugins. No existing values were replaced; final values were read back and verified.

    Trusted origin/main (04bdce8111ca3dbdd136c63fad3e36f56e5814c0) explicitly bounds invocation draining and proceeds after timeout. Defining caller settlement and cooperative cancellation across plugin entry points is lifecycle-design work, rather than the separate crash-containment defect. Limited reload/disposal scope supports Medium priority; cross-entry-point lifecycle semantics support High effort.

    No reproduction report or pull request: the final Type is Task, so the bug-report and fix stages do not apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugins

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions