Open a-gardner1 opened 1 year ago
I didn't consider the possibility of a sigkill preventing the successful removal of a switch after the write lock is in place, but I would assume the write lock on the file disappears with the process.
A comprehensive solution should provide a clean up method to finish any unfinished removal due to sigkill. One example is at the start of a switch manager, which would delete any switches that were cloned but currently do not have any active read locks.
A rough sketch of a solution involves creating a read lock for the switch directory that lasts for the lifetime of each
OpamSwitch
object. Cloned switches would need to also place a lock on their origin switch to prevent it from being deleted.Below is an example that got thrown out in early discussions. Note that it is INCORRECT in that it deletes the actual switch directory upon deletion of the
OpamSwitch
object. Instead, a switchIdeally, we would mimic opam's locking mechanisms so that external opam processes are also locked out from modifying switches in use by our switch managers.