Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

DockerRunner: include stderr in log on failure. #1059

Merged
merged 1 commit into from
May 25, 2021

Conversation

tmds
Copy link
Member

@tmds tmds commented May 25, 2021

@jkotalik ptal

// Even though the Exited event has been raised, WaitForExit() must still be called to ensure the output buffers
// have been flushed before the process is considered completely done.
process.WaitForExit();
lock (process)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this potential race so I added a lock for it.

var result = await application.ContainerEngine.RunAsync(
command,
throwOnError: false,
cancellationToken: cancellationToken,
outputDataReceived: data => service.Logs.OnNext($"[{replica}]: {data}"),
errorDataReceived: data => service.Logs.OnNext($"[{replica}]: {data}"));
errorDataReceived: data => { service.Logs.OnNext($"[{replica}]: {data}"); stderr.AppendLine(data); });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual fix.

@jkotalik jkotalik merged commit b1aaca8 into dotnet:main May 25, 2021
@jkotalik
Copy link
Contributor

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants