mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-18 21:33:11 +00:00
terminate process before waiting for exit with timeout
solved an issue on windows where the processes were not exiting cleanly and causing an attempted write to the dht db after the data dir had already been deleted
This commit is contained in:
parent
cccec6574c
commit
ec5cf2ad96
@ -120,8 +120,12 @@ method stop*(node: NodeProcess) {.base, async.} =
|
||||
await node.trackedFutures.cancelTracked()
|
||||
if node.process != nil:
|
||||
try:
|
||||
trace "terminating node process..."
|
||||
if errCode =? node.process.terminate().errorOption:
|
||||
error "failed to terminate process", errCode
|
||||
|
||||
trace "waiting for node process to exit"
|
||||
let exitCode = await node.process.waitForExit(ZeroDuration)
|
||||
let exitCode = await node.process.waitForExit(3.seconds)
|
||||
if exitCode > 0:
|
||||
error "failed to exit process, check for zombies", exitCode
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user