Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes a bar fails to clear after completing and calling Wait #68

Closed
cipriancraciun opened this issue May 21, 2020 · 3 comments
Closed

Comments

@cipriancraciun
Copy link

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?

@cipriancraciun
Copy link
Author

cipriancraciun commented May 21, 2020

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.

@vbauerster
Copy link
Owner

Thanks for reporting! Can you please check on latest master? I just pushed commits, which should fix this.

@cipriancraciun
Copy link
Author

Yes, I can confirm that by using the latest commit the issue seems to be solved: dc22c1b

Thanks! I'll close this issue. (If it resurfaces, I'll reopen it again.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants