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

Nodes in the context are not serialized #1353

Closed
sphuber opened this issue Mar 29, 2018 · 0 comments · Fixed by #1354
Closed

Nodes in the context are not serialized #1353

sphuber opened this issue Mar 29, 2018 · 0 comments · Fixed by #1354
Assignees
Milestone

Comments

@sphuber
Copy link
Contributor

sphuber commented Mar 29, 2018

This is a bug that exists in the old version of plumpy that is being used by all current releases and develop. It does not exist in the new plumpy and therefore in the workflows branch. This bug is also the real underlying reason for issue #1292 .

The problem is that the context of WorkChains is not serialized, which means that if a user populates it with nodes, when the WorkChain is persisted, the node instances themselves are pickled. When the instance is recreated from the pickle, the node instance is reloaded from the pickled object. For django this is not a problem, but for SqlAlchemy, however, the session that contained the old DbNode reference is gone, and when the node instance is restored, accessing it will lead to a DetachedInstanceError because the DbNode has not been reinserted into the session.

The solution is simple, the context simply has to be serialized. While we are at it, we should use the same serialization that is used in workflows to serialize the inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant