Skip to content

Commit

Permalink
progress: always force a render on shutdown
Browse files Browse the repository at this point in the history
fix a race issue where a cancelled context might cause the progress
bar to never be rendered.

More details here: containers/image#1013

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jul 29, 2021
1 parent 5fca739 commit 8eb06b3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,8 @@ func (p *Progress) serve(s *pState, cw *cwriter.Writer) {
p.dlogger.Println(err)
}
case <-s.shutdownNotifier:
if s.heapUpdated {
if err := s.render(cw); err != nil {
p.dlogger.Println(err)
}
if err := s.render(cw); err != nil {
p.dlogger.Println(err)
}
return
}
Expand Down

0 comments on commit 8eb06b3

Please sign in to comment.