Elektrobit / flake-pilot

Registration/Control utility for applications launched through a runtime-engine, e.g containers
MIT License
9 stars 5 forks source link

CID file not always cleaned up properly #132

Open Ichmed opened 1 year ago

Ichmed commented 1 year ago

If the podman pilot panics after creating the CID file, rerunning the pilot will error with the message Container id in use by another instance, consider @NAME argument even though there is no container running. The only way to fix this is to delete the CID file manually.

To fix this we should

  1. Perform cleanup if the pilot terminates mid-launch
  2. Remove the CID file if there is no container actually running and/or continue execution instead of terminating since the ID is free

Both should be implemented since an invalid CID file might exist even after a cleanup function has been implemented.

The existing gc_cid_file() method should be reused/refactored for this