progress: ensure bake waits for progress to finish printing on error conditions #3248
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some minor fixes to the printer and how bake invokes it. Bake previously
had a race condition that could result in the display not updating on an
error condition, but it was much rarer because the channel communication
was much closer. The refactor added a proxy for the status channel so
there was more of an opportunity to surface the race condition.
When bake exits with an error when reading the bakefiles, it doesn't
wait for the printer to finish so it is possible for the printer to
update the display after an error is printed. This adds an extra
Wait
in a defer to make sure the printer is finished.
Wait
has also been fixed to allow it to be called multiple times andhave the same behavior. Previously, it only waited for the done channel
once so only the first wait would block.
The
onclose
method is now called every time the display is paused orstopped. That was the previous behavior and it's been restored here.
The display only gets refreshed if we aren't exiting. There's no point
in initializing another display if we're about to exit.
The metric writer attached to the printer was erroneously removed. It is
now assigned properly.