Skip to content

Panic in Job causes Cargo to hang indefinitely. #6433

@ehuss

Description

@ehuss

If a Job ever panics, Cargo will hang indefinitely. I've seen this a few times during development (and a recently exposed bug in metabuild).

The issue is that if this line ever panics:

let res = job.run(fresh, &JobState { tx: my_tx.clone() });

the following line never sends the Message::Finish message, and the main thread hangs waiting for the finish message.

Dealing with this is a little more difficult than I expected. catch_unwind can't be used because Message is not unwind safe due to the reference. Any ideas for an easy way to deal with it? Is this worth fixing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargo-apiArea: cargo-the-library API and internal code issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions