Skip to content

Commit aa4cc0b

Browse files
committed
Stop waiting on ExitedWithError
The state machine is only configured to be able to transition to the ExitedSuccessfully state from the Stopping state when the ProcessExit trigger is triggered which means that there is no benefit to doing so.
1 parent cfdba1c commit aa4cc0b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/LittleForker/ProcessSupervisor.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,7 @@ private async Task OnStop(TimeSpan? timeout)
312312
// only means the process has _started_ to shut down.
313313

314314
await CooperativeShutdown.SignalExit(ProcessInfo.Id, _loggerFactory).TimeoutAfter(timeout.Value);
315-
var exited = this.WhenStateIs(State.ExitedSuccessfully);
316-
var exitedWithError = this.WhenStateIs(State.ExitedWithError);
317-
318-
await Task
319-
.WhenAny(exited, exitedWithError)
320-
.TimeoutAfter(timeout.Value);
315+
await this.WhenStateIs(State.ExitedSuccessfully).TimeoutAfter(timeout.Value);
321316
}
322317
catch (TimeoutException)
323318
{

0 commit comments

Comments
 (0)