bors e370c83af4 Auto merge of #9201 - ehuss:close-error-during-drain, r=Eh2406
Fix hang on broken stderr.

If stderr is closed and cargo tries to print a status message such as "Compiling", cargo can get into a hung state. This is because the `DrainState::run` function would insert the job into the `active` queue, and then return an error without starting the job. Since the job isn't started, there is nothing to remove it from the `active` queue, and thus cargo hangs forever waiting for it to finish.

The solution is to move the call to `note_working_on` earlier before the job is placed into the active queue.

This addresses the issue noted in https://github.com/rust-lang/cargo/issues/8714#issuecomment-783787163.
2021-02-24 04:40:06 +00:00
..
2020-08-10 11:29:28 -07:00