Skip to content

fix(plugin-native): join worker thread on run_processor exit paths #522

@staging-devin-ai-integration

Description

Problem

run_processor drops InstanceWorker without joining the worker thread (same class of issue as #481 but for processor plugins). The Drop impl detaches the thread, which is safe (the Arc<InstanceState> keeps the plugin alive) but can trigger the same dlclose/SIGSEGV race under coverage instrumentation or fast process teardown.

Context

PR #519 fixed this for run_source by storing the JoinHandle in InstanceWorker and calling shutdown().await on all exit paths. The same restructuring should be applied to run_processor — its main processing loop already captures results in an async block, so wiring in worker.shutdown().await after it should be straightforward.

Suggested approach

After the main loop and input task cleanup in run_processor, call worker.shutdown().await before returning the result. The InstanceWorker::shutdown() method already exists from #519.

Related: #481, #519

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions