You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although I've used BarRemoveOnComplete on AddBar, I am making sure SetTotal and SetCurrent are correctly set to be completed, and I'm waiting for Wait to complete, sometimes the bar fails to be removed after completion.
Through experimentation, I've observed that waiting after Wait the same amount of time (plus some extra) as I've set with mpb.WithRefreshRate, seems to solve the issue.
This makes me think there is perhaps a race condition happening inside Wait?
The text was updated successfully, but these errors were encountered:
Based on some further experimentation it seems that although after Wait returns there are no more goroutines running (except the main one), in some cases the bar still is not removed, which points away from a potential race condition in the code, and towards a "logic" issue.
I have also made sure to os.Stderr.Sync () (which I've used for WithOutput), so the issue is not buffering.
I've also made sure to panic if Completed is false (before calling Wait), and also checked that BarCount is zero (after returning Wait). In all cases when the bar remained visible no panic exception occurred, which further leads towards mainly a display bug.
Although I've used
BarRemoveOnComplete
onAddBar
, I am making sureSetTotal
andSetCurrent
are correctly set to be completed, and I'm waiting forWait
to complete, sometimes the bar fails to be removed after completion.Through experimentation, I've observed that waiting after
Wait
the same amount of time (plus some extra) as I've set withmpb.WithRefreshRate
, seems to solve the issue.This makes me think there is perhaps a race condition happening inside
Wait
?The text was updated successfully, but these errors were encountered: