Filter active processes for the default user when running verdi process repair
#6879
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR applies a filter on the active processes picked up by
verdi process repair
. The command takes the difference between the set of active processes and queued processes and adds the difference to the broker queue. However, in recent developments of a shared AiiDA setup, the database table of queued jobs (DbQueue
) may hold jobs from different profiles (multiple profiles share the database). The broker should not pick up jobs from a profile different from the default user. Here, I apply this exact filter on active jobs (if process.user.is_default
). This ensures that the broker does not pick up jobs from any other profile attached to the database.I don't believe this breaks anything, as there should be no other user with active processes. Here, by active I mean jobs which the broker should correctly attempt to repair. I believe the concept of
User
in AiiDA was mostly to differentiate imported processes and data. But these processes should not be active (e.g. running, waiting). So the filter in the end makes no difference for single-profile-use database use cases.