Skip to content

make update_progress_bar a bit more robust by just doing nothing if the corresponding progress bar was not started (and making stopping of a non-started progress bar fatal) #3867

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

Merged
merged 3 commits into from
Oct 22, 2021

Conversation

boegel
Copy link
Member

@boegel boegel commented Oct 21, 2021

Without these changes, calling update_progress_bar when the progress bar was not started yet means trouble:

Traceback (most recent call last):
   ...
  File "/home/kehoste/easybuild-framework/easybuild/tools/output.py", line 304, in update_progress_bar
    (pbar, task_id) = _progress_bar_cache[bar_type]
KeyError: 'extensions'

Raising a KeyError is pretty nasty, since it gives zero info when it's reported without the traceback.

In #3667 I've moved update_progress_bar into EasyBlock.init_ext_instances for example, which sometimes gets called without the start_progress_bar in extensions_step.
In that case, updating the progress bar doesn't make much sense, and making sure it's only called when an extensions progress bar is actually "active" would be tricky (and lead to ugly code).

…he corresponding progress bar was not started (and making stopping of a non-started progress bar fatal)
@easybuilders easybuilders deleted a comment from boegelbot Oct 22, 2021
@branfosj
Copy link
Member

Going in, thanks @boegel!

@branfosj branfosj merged commit e358782 into easybuilders:develop Oct 22, 2021
@boegel boegel deleted the robust_update_progress_bar branch October 22, 2021 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants