ContextImpl::launch() tries to avoid reentrance problems in libgromacs by keeping track of a session launched from it using a weak pointer, but this has increasingly led to false positives in ongoing development. We now require that a Session be close()d to force the shutdown of the mdrunner at a known point. After the call to close(), the Context should be able to launch a new session.
Before simply updating the weak pointer check and reassignment, though, I need to make sure we don't have anything silly where keeping a handle to a closed session assumes that the ContextImpl can still find that session.
This bug probably wasn't more obvious because of inconsistent Python garbage collection, but ultimately the C++ API should handle the situation better. It is related to various implementation details of WorkSpec, Context, and Session, that are due for overhaul (the subject of a growing number of other issues) but this bug should be fixed for 0.0.7 ASAP.
ContextImpl::launch() tries to avoid reentrance problems in libgromacs by keeping track of a session launched from it using a weak pointer, but this has increasingly led to false positives in ongoing development. We now require that a Session be
close()d to force the shutdown of the mdrunner at a known point. After the call toclose(), the Context should be able to launch a new session.Before simply updating the weak pointer check and reassignment, though, I need to make sure we don't have anything silly where keeping a handle to a closed session assumes that the ContextImpl can still find that session.
This bug probably wasn't more obvious because of inconsistent Python garbage collection, but ultimately the C++ API should handle the situation better. It is related to various implementation details of WorkSpec, Context, and Session, that are due for overhaul (the subject of a growing number of other issues) but this bug should be fixed for 0.0.7 ASAP.