Skip to content

Commit a10916a

Browse files
committed
Merge #585: bitcoind: call wait in drop to reap process
c08ea32 bitcoind: call wait in drop to reap process (Nick Johnson) Pull request description: Over in [rust-psbt we are seeing integration test failures](https://git.rust-bitcoin.org/rust-bitcoin/rust-psbt/actions/runs/58/jobs/8/attempt/1) which result in a CI runner spinning for hours, even though the test failed in a minute. Setting aside why the test failed (looks bitcoind related but dunno what), I am wondering if we should have a stronger guarantee in the drop to clean up the process. I looked back in the [old archive for the original impl reasoning](rust-bitcoin/bitcoind#52) and don't see much. I could also see this being a big no-no in a Drop impl, but for a high level thing like the bitcoind process maybe better than not? ACKs for top commit: tcharding: ACK c08ea32 Tree-SHA512: 9a1ff79f4f8ad3735363cc385f235fd3dc99643965b4f134de5514014167f8e41baf313384173d8404e650d2cfcf74d1f99dcd3edf4f596a5922a49cf83a6d5a
2 parents 92c44b3 + c08ea32 commit a10916a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

bitcoind/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,13 @@ impl BitcoinD {
573573

574574
impl Drop for BitcoinD {
575575
fn drop(&mut self) {
576+
// Frist attempt graceful shutdown for persistent directories,
577+
// always fallback to force kill and wait for process to be reaped.
576578
if let DataDir::Persistent(_) = self.work_dir {
577579
let _ = self.stop();
578580
}
579581
let _ = self.process.kill();
582+
let _ = self.process.wait();
580583
}
581584
}
582585

0 commit comments

Comments
 (0)