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

Mark relevant Process exit codes as invalidates_cache=True #5709

Merged
merged 2 commits into from
Oct 21, 2022

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Oct 21, 2022

Fixes #5708

The Process and CalcJob classes define various exit codes, all of
which will correspond to processes that should not be used as a source
for caching. Therefore, these exit codes should properly declare
invalidate_cache=True which will automatically prevent any node with
that exit code from being cached from.

The ArithmeticAddCalculation and `TemplatereplacerCalculation plugins
are also updated to properly mark exit codes that should not be cached
from.

The `Process` and `CalcJob` classes define various exit codes, all of
which will correspond to processes that should not be used as a source
for caching. Therefore, these exit codes should properly declare
`invalidate_cache=True` which will automatically prevent any node with
that exit code from being cached from.

The `ArithmeticAddCalculation` and `TemplatereplacerCalculation plugins
are also updated to properly mark exit codes that should not be cached
from.
The exit codes where specified in the 100 range, which is reserved (by
convention) for exit codes defined by the `CalcJob` class. In fact, some
of them even overlapped with existing exit codes defined by `CalcJob`.
There currently is no logic in `aiida-core` that will prevent or at
least warn when existing exit codes get overwritten so this went
unnoticed until now.

Since the plugin is mostly used for internal testing purposes, there
will not be an automated database migration to update existing exit
codes.
Copy link
Member

@ltalirz ltalirz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sphuber , that makes sense to me!

I don't know how many plugins actually use these low-integer exit codes, but to the degree that they do, this will be helpful.

@sphuber sphuber merged commit c0d28ab into aiidateam:main Oct 21, 2022
@sphuber sphuber deleted the fix/5708/invalidates-cache branch October 21, 2022 15:58
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

Successfully merging this pull request may close these issues.

Mark relevant Process exit codes as invalidates_cache=True
2 participants