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

DM-26302: Use new registry method to reset connection pool. #116

Merged
merged 1 commit into from Mar 2, 2021

Conversation

andy-slac
Copy link
Collaborator

This allows passing Butler to a subpocess without pickling it when using
fork start method.

This allows passing Butler to a subpocess without pickling it when using
fork start method.
quantum_pickle = pickle.dumps(self.qnode.quantum)
taskDef = self.qnode.taskDef
logConfigState = CliLog.configState
mp_ctx = multiprocessing.get_context(startMethod)
self.process = mp_ctx.Process(
target=_Job._executeJob,
args=(quantumExecutor, taskDef, quantum_pickle, butler_pickle, logConfigState),
args=(quantumExecutor, taskDef, quantum_pickle, butler, logConfigState),
Copy link
Member

Choose a reason for hiding this comment

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

I was surprised pickling works here, because of the DimensionUniverse pickle implementation that doesn't really save anything. But I see it worked before, and you'r just slightly changing how it works. Is there an explicit workaround for the DimensionUniverse pickling that just isn't in this diff?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

DimensionUniverse is not pickled but it is re-initialized by registry when we re-instantiate butler (or if the existing butler is used with fork). This is why I need to delay Quantum un-pickling until afer butler is unpickled (by multiprocessing if spawn method is used).

@andy-slac andy-slac merged commit b3d82cf into master Mar 2, 2021
@andy-slac andy-slac deleted the tickets/DM-26302 branch March 2, 2021 18:39
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.

None yet

2 participants