https://pantsbuild.org/ logo
a

average-vr-56795

10/30/2019, 4:21 PM
Session
is a cheap wrapper around an
Arc<InnerSession>
which we clone and drop all over the place;
InnerSession
is the thing that has the correct lifetime
h

hundreds-breakfast-49010

10/30/2019, 10:38 PM
if I implement
Drop
on
InnerSession
, and just have the drop method print a line, I find that that line never gets printed
which I assume has something to do with interaction with the python FFI
I actually even added a panic and I forgot that I had left that in the code - it never gets called
a

average-vr-56795

10/31/2019, 9:04 AM
Interesting… Maybe we keep too many references to the Python
Session
object, or it’s referenced in a cycle somewhere, or something?
Maybe we need to explicitly call
session_destroy
where we expect to be done with the
Session
on the Python side, rather than relying on
ffi.gc
to call it?
h

hundreds-breakfast-49010

10/31/2019, 5:16 PM
@average-vr-56795 when on the python side can we be sure we're done with a session?
also maybe it doesn't matter, and we can just start/stop a thread that polls the
Session
for the latest workunts purely in python
which is the approach I'm currently taking
a

average-vr-56795

10/31/2019, 5:35 PM
LocalPantsRunner._run
creates (via one of its method calls) the
Session
, and the
Session
can be cleaned up before that method returns