https://pantsbuild.org/ logo
#development
Title
# development
a

adamant-mouse-92628

12/31/2019, 12:28 AM
@hundreds-breakfast-49010 one idea is to use mdmfs (or tmpfs). We could then clean up ourself each time we start
h

hundreds-breakfast-49010

12/31/2019, 12:38 AM
I think this would entail writing our own custom version of the
tempfile
crate, at least for writes to temp dirs that happen in rust
"The
TempDir
type creates a directory on the file system that is deleted once it goes out of scope. At construction, the
TempDir
creates a new directory with a randomly generated name."
this is what we're using to create the
process-execution-<random>
dir. so if we wanted to create our own tmpfs filesystem, we'd have to replace this call with someting that knows how to write there
well, hm, I guess we could come up with a canonical location for this filesystem, and just make sure that every time we make a tmpdir we write it there, bypassing /tmp altogether
I am not 100% sure why the drop destructors aren't getting called as it is, but I suspect it's some weirdness with rust-python FFI
that's something we should be more mindful of, whenever we use rust code that assumes that some cleanup behavior will happen on drop, we should make sure that there's no chance execution will pass back to python before that time, or else we can't guarantee that python won't do something that will cause the program to exit without calling those destructors
a

aloof-angle-91616

12/31/2019, 1:45 AM
hm, ok. thank you for describing this in depth!
i didn’t realize that you were describing this issue with drop as separate from the /tmp cleanup issue
h

hundreds-breakfast-49010

12/31/2019, 7:47 AM
well, I think it's the causal factor behind /tmp not getting cleaned up, at least in this case. but I ran into a case where rust destructers weren't getting run, probably because of FFI issues, at least once before