Use UNMERGED vbauerster/mpb PR to fix a pull deadlock

> go mod edit -replace github.com/vbauerster/mpb/v7=github.com/mtrmac/mpb/v7@abort-deadlock
> make vendor

See https://github.com/vbauerster/mpb/issues/100 and
https://github.com/vbauerster/mpb/pull/101 .

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2021-08-31 15:17:45 +02:00
parent 83de22e892
commit 9f7bad7dac
4 changed files with 8 additions and 5 deletions

View File

@ -268,13 +268,15 @@ func (b *Bar) SetPriority(priority int) {
// if bar is already in complete state. If drop is true bar will be
// removed as well.
func (b *Bar) Abort(drop bool) {
if drop {
b.container.dropBar(b) // It is safe to call this multiple times with the same bar
}
select {
case b.operateState <- func(s *bState) {
if s.completed == true {
return
}
if drop {
b.container.dropBar(b)
b.cancel()
return
}