-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UUID as traitlets for threading related widgets (#375)
AiiDA is not thread-safe, for the node queried from DB, it will live at the end of DB session. In the AiiDAlab widget, we use threading for the widget since we don't want to block the whole notebook in some long running operation. However, the some traitlets in the widget implementation are AiiDA node, which lead to the issue that when the threading is closed the session also finalized thereafter the node is expired and invalid to be used. For more details of discussion about theread-local problem: check aiidateam/aiida-core#5765 Here, we break the API by changing all the traitlets that use AiiDA node to the static UUID, only loading the node and consuming it in the local scope. The PR involves all the widgets that explicitly using threading for the AiiDA node. There are possibilities that the other thread trigger the traitlets change and having AiiDA node in the extra threading, which also cause the exactly same issue. One of the example is the `ComputationalResourceWidget`, which has AiiDA code node as traitlets but has no threading. The issue happened when it is called from QeApp by additional threading from code setup widget. In the future, we will change all the traitlets to UUID.
- Loading branch information
Showing
2 changed files
with
95 additions
and
105 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