Closed jingxiaolu closed 4 years ago
This issue has been fixed, see #73. Bump to v5.2.4
Thanks @vbauerster I'll bump to v5.2.4 and test again!
@jingxiaolu Feel free to reopen or create a new one if you find a bug.
Thanks @vbauerster testing passed with v5.2.4~
versions:
background
We're using containers/image to handle container images. And it will use mpb to produce progress bars.
With it, it uses mpb as:
We encounter an issue that, if this context is cancel during or before
pool.AddBar()
, the mpb will be stuck with this stack:Analyze
We checked the code, it is because:
1) during
newBar()
->bar.serve()
, the context is cancel, so thisbar.serve()
is returned immediately:2) so, after this
newBar()
,bar.subscribeDecorators()
->b.TraverseDecorators
is called, and stuck at:Possible RC
Add a
select
andcase <-b.done
to those writing places ofb.operateState <- func(s *bState)
can fix this issue. Patch: