evict .exec variant when its digest is evicted#2503
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@MarcusSorealheis wondering thinking between your approach (deleting associated exec files on the call back post deletion, thus not counting in overall running size count), vs keeping track of the exec files in the size count? Basically if you wait to do the exec eviction like this the size count wont technically be accurate as it will be missing those exec sizes. |
|
Also, if a digest gets evicted while its .exec copy is still being created, the eviction's cleanup runs too early before there's anything to delete? Then the copy would get published with no owner and still leak into memory until restart. Not sure if this will happen a lot based on timing or if its an edge case? |
|
It's a good question.. I did consider giving .exec its own tracked size in evicting_map and went with the callback/tether approach instead, for a few reasons. The first is, The actual failure that @dkostyrev pointed out is unbounded disk growt:
and here, deleting a digest's .exec sibling via the existing remove-callback hook whenever that digest is evicted from the primary map bounds total disk to ~2x Also, I did not want to add any additional config options or accounting if not absolutely necessary. |
|
@MarcusSorealheis Ok so for the race condition I mentioned, can you do something to recheck membership after create_executable_variant publishes the variant, so if the digest was evicted mid-copy and the exec file is now orphaned, we follow up by deleting it and returning NotFound? |
yes, good thinking. hold my beer! |
b11dfce to
51dbcf3
Compare
51dbcf3 to
20a2f58
Compare
Description
Evict .exec variant when the digest is evicted. Pretty simple..
Fixes #2474
Type of change
Please delete options that aren't relevant.
How Has This Been Tested?
bazel testChecklist
bazel test //...passes locallygit amendsee some docsThis change is