Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Vouch request: fix orphaned trigger-dev-run-worker processes after SIGKILL #3478

Copy link
Copy link
@thegodtune

Description

@thegodtune
Issue body actions

Why do you want to contribute?

I'd like to fix issue #2909: orphaned trigger-dev-run-worker processes that accumulate and consume significant CPU when the CLI is killed ungracefully (e.g. via pnpm's SIGKILL).

I traced the bug through DevSupervisor, TaskRunProcessPool, and the existing watchdog introduced in #3191. The watchdog correctly handles server-side run cancellation, but doesn't kill the OS-level worker processes on the user's machine. My fix extends the watchdog to read worker PIDs from active-runs.json and SIGTERM -> SIGKILL them when the parent CLI dies.

I've tested this end-to-end against a local self-hosted instance, SIGKILL the CLI, wait ~5 seconds, and all worker processes are dead.

The change touches three files: TaskRunProcessPool (adds getAllPids()), DevSupervisor (writes workerPids to active-runs.json with a 2s refresh), and devWatchdog (kills those PIDs on parent death).

Prior contributions or relevant experience

I'm a backend engineer with 5+ years of experience building distributed systems in Node.js/TypeScript. My stack closely mirrors Trigger.dev's internals, NestJS, TypeScript, PostgreSQL, Redis, BullMQ, and queue-based job orchestration. I have a published research preprint on a Multi-Pipeline Outbox Pattern as an alternative to Kafka for moderate-scale systems (DOI: 10.21203/rs.3.rs-8328306/v1). I've also contributed to Debian's open-source projects through the Debian JavaScript Team (Outreachy internship, DebConf 2022 presenter).

GitHub: https://github.com/thegodtune

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.