Skip to content

fix(install): land queue-worker throws on the task instead of the process - #58

Merged
dshplugin merged 1 commit into
dshplugin:mainfrom
simpleqt:sq920/queue-worker-catch
Sep 21, 2026
Merged

dshplugin merged 1 commit into
dshplugin:mainfrom
simpleqt:sq920/queue-worker-catch

Conversation

@simpleqt

Copy link
Copy Markdown
Contributor

Motivation

pumpQueue runs void runPluginMutation({ ...options, task }).finally(() => { ... }) with no .catch. A rejection inside the mutation is therefore an unhandled rejection — process-fatal on Node ≥ 15 — while the .finally still runs and pumps the next task: the worst of both (crash + queue continuing).

A reachable throw exists: the allowBuilds recovery path calls writeFileSync (profile.ts, the only I/O in that path not wrapped in try/catch — the preceding readFileSync is). It runs precisely in flaky environments (that's what the recovery exists for), so EACCES/EROFS/ENOSPC there is plausible.

Changes

Catch before the finally: land the throw on the task (failed status, [internal] line via pushLine), then let the existing .finally branch log install-failure as usual. Cancelled tasks are left alone.

Testing

  • Full suite node --test: 51/51 pass; npm run typecheck clean.

    Proof
    ℹ tests 51
    ℹ pass 51
    ℹ fail 0
    

…cess

pumpQueue voids runPluginMutation(...).finally(...) with no catch, so
any throw inside the mutation — reachable via the allowBuilds recovery
path's writeFileSync (EACCES/EROFS/ENOSPC) — surfaces as an unhandled
rejection (process-fatal on Node >= 15) while the queue itself keeps
pumping in the finally. Catch it, mark the task failed with an
[internal] line, and let the existing finally branch log it like any
other install failure.
Copilot AI lite review requested due to automatic review settings September 20, 2026 12:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dshplugin
dshplugin merged commit 6bd736f into dshplugin:main Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants