Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/JD.AI/Startup/WelcomeServiceStatusProbe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ private static Uri BuildHealthUri(Uri baseUri)
try
{
await process.WaitForExitAsync(linkedCts.Token).ConfigureAwait(false);
// WaitForExitAsync does not guarantee that the redirected stdout/stderr
// streams have been fully flushed into the reader tasks before it returns
// (unlike the synchronous WaitForExit() overload). Calling the no-arg
// synchronous overload here ensures all pending stream data is drained
// before we await the reader tasks, eliminating a race on Linux CI where
// the process exits and the async wait completes before the OS has
// delivered all buffered output to the pipe.
process.WaitForExit();
var output = await outputTask.ConfigureAwait(false);
var error = await errorTask.ConfigureAwait(false);
return (process.ExitCode, output, error, false);
Expand Down
Loading