https://pantsbuild.org/ logo
w

witty-crayon-22786

06/03/2020, 6:18 PM
@average-vr-56795: hello! i’ve been taking another look at GC recently, and was wondering if you remembered why we didn’t end up doing lease-extension-on-access
afaict, we only extend leases in pantsd
was it because if something was garbage collected outside the context of a single run (or the lifetime of pantsd), we felt that it would be fine for it to just be re-captured?
a

average-vr-56795

06/03/2020, 6:32 PM
I think we were anticipating pantsd becoming the default/only way of running soon enough to hope it wouldn’t matter, because extending leases requires a write mutex (but maybe we could do that in a background thread, maybe even in batches, or something)
Certainly wouldn’t object to extending leases on access
w

witty-crayon-22786

06/03/2020, 6:37 PM
yea, i remember discussing how to do it, but i think that until looking at this again yesterday, i thought that we had done it, heh
(royal we, of course)
basically, don’t extend on “every” access… but extend if the lease time is “approaching”. so mostly still read-only.
when you say that it requires a write “mutex” though, what do you mean? just a write, right?
rite, wright
a

average-vr-56795

06/03/2020, 6:57 PM
Writing to lmdb takes an exclusive file lock on the underlying lmdb file
w

witty-crayon-22786

06/03/2020, 6:57 PM
yea. so a standard write. got it.
a

average-vr-56795

06/03/2020, 6:57 PM
Yeah 🙂