-
Notifications
You must be signed in to change notification settings - Fork 117
[bugfix] Fix bug in unloading of conflicting modules #405
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
Conversation
* Fix bug which led to accumulation of module unloading. * Use raw string to avoid warnings.
Codecov Report
@@ Coverage Diff @@
## master #405 +/- ##
==========================================
+ Coverage 91.23% 91.23% +<.01%
==========================================
Files 70 70
Lines 8581 8582 +1
==========================================
+ Hits 7829 7830 +1
Misses 752 752
Continue to review full report at Codecov.
|
vkarak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what was exactly the bug and how it was triggered precisely?
|
Imagine that module A conflicts with module C and module B conflicts with D. If we wanted to load modules A, B, looping through them would do the following:
|
|
@teojgo Good, I get it now. |
reframe/core/environments.py
Outdated
| for conflict in self._conflicted: | ||
| module_conflicts = rt.modules_system.load_module(m, force=True) | ||
| self._conflicted += module_conflicts | ||
| for conflict in module_conflicts: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loop variable should be simply m.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its a nested loop and the outer one already uses m
reframe/core/environments.py
Outdated
| self._conflicted += rt.modules_system.load_module(m, force=True) | ||
| for conflict in self._conflicted: | ||
| module_conflicts = rt.modules_system.load_module(m, force=True) | ||
| self._conflicted += module_conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this assignment after the loop. Placed here, it kind of lets you expect that self._conflicted will be used just right after.
reframe/core/environments.py
Outdated
|
|
||
| self._conflicted += rt.modules_system.load_module(m, force=True) | ||
| for conflict in self._conflicted: | ||
| module_conflicts = rt.modules_system.load_module(m, force=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd name this simply conflicted.
Fix bug which led to accumulation of module unloading.
Use raw string to avoid warnings.
Fixes #59