forked from aiidateam/aiida-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Caching: Remove core and plugin information from hash calculation
When the caching mechanism was first introduced, precaution was taken to reduce the chances for false positive cache hits to a miniumum as much as possible. For that reason, the version of the package that provides the node class was included in the calculation of the hash. This would cover `Data` plugins, however, since the `ProcessNode` class is not subclassable, there the version information was added slightly differently. When a `Process` is run, the `version` attribute was added to the attributes of its `ProcessNode` which includes the version of `aiida-core` that is currently installed, as well as that of the plugin package providing the process plugin. Now that caching has been battle-tested and shown to be useful in practice, this approach turns out to be too limiting. Now, whenever a new version of `aiida-core` or a plugin is installed, the associated nodes are invalidated as valid cache sources as future node instances will have a different hash, merely because the version has changed. Therefore, the version information is removed from the calculation of the hash. The explicit version of the package providing the node class that was explicitly added in `NodeCaching.get_objects_to_hash` is removed and the `version` attribute is added to the list of `_hash_ignored_attributes`.
- Loading branch information
Showing
5 changed files
with
37 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters