Skip to content

Commit 70f75d8

Browse files
committed
WaitForExitAsync is needed to wait for process to exit after kill signal
1 parent c7760a5 commit 70f75d8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ServiceControl.RavenDB/EmbeddedDatabase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ public async Task Stop(CancellationToken cancellationToken)
206206
Logger.WarnFormat("Killing RavenDB server PID {0} child process because host cancelled", processId);
207207
var ravenChildProcess = Process.GetProcessById(processId);
208208
ravenChildProcess.Kill(entireProcessTree: true);
209+
// Kill only signals
210+
Logger.WarnFormat("Waiting for RavenDB server PID {0} to exit... ", processId);
211+
await ravenChildProcess.WaitForExitAsync(CancellationToken.None);
209212
}
210213
catch (Exception e)
211214
{

0 commit comments

Comments
 (0)