-
Notifications
You must be signed in to change notification settings - Fork 880
rkt image gc will remove images for *running* containers #3385
Comments
@dansteen thanks for the report. You are right, the name is definitely misleading as the timestamp is taken from the DB and it is updated at pod starting time. As there is no daemon doing realtime book-keeping for us, image gc/list don't know about currently running pods. This is not a problem for the treestore, as it knows about running apps from their treestoreid (to be checked: what about non-overlayfs pods?). For the imagestore however the GC only checks the timestamp in DB, which effectively is the last starting time. I think we should do two things here:
|
@dgonyeo do you see a chance of tackling this? |
@s-urbaniak sure. Some clarification first though: Does this mean that if I started a container a week ago, and it ran continuously up until it was killed 30 seconds ago, and I run Although telling when a container for an image stopped running would be very hard with our architecture, so maybe this is fine. |
I think we should just make explicit that "used" here really means started (see the other two bugs referenced here). The most pressing point here however is adding a check to exclude still-running images from GC at all. |
Environment
What did you do?
let that run, and in a different shell
What did you expect to see?
I expected rkt to consider images with still running containers to still be "in use", and to not clean them up.
What did you see instead?
rkt bases its "in use" metric off the last time a container was started off that image and deletes images with still running containers.
As a note, The
--grace-period=1s
in the commands above is just for testing purposes.The text was updated successfully, but these errors were encountered: