Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.

Conversation

@iaguis
Copy link
Member

@iaguis iaguis commented Nov 10, 2015

To get the pod preparation/creation time we use the modification time in
/var/lib/rkt/pods/*/<UUID>. It gets modified when the pod is prepared
and when the pod is created and doesn't change afterwards.

To get the pod exit time we use the modification time in
/var/lib/rkt/pods/*/<UUID>/stage1. The reason is that systemd-nspawn
creates a lock file there, and removes it when the container exits (even
if it was killed).

# rkt list
UUID        APP         IMAGE NAME               STATE      SINCE           NETWORKS
00b6a077    busybox     busybox:latest           exited     23 hours ago    
            etcd        coreos.com/etcd:v2.0.10                     
1308fdae    etcd        coreos.com/etcd:v2.0.10  exited     4 hours ago 
2ded32e4    busybox     busybox:latest           prepared   2 hours ago 
47c0d9c2    busybox     busybox:latest           running    9 seconds ago   default:ip4=172.16.28.91
# rkt list --full
UUID                                    APP            IMAGE NAME                IMAGE ID               STATE        SINCE                                 NETWORKS
00b6a077-abd5-41ff-a5f6-5e5e90c16dcf    busybox        busybox:latest            sha512-77d0b085eaca    exited       2015-11-09 15:55:35.699 +0100 CET
                                        etcd           coreos.com/etcd:v2.0.10   sha512-c03b055d02e5
1308fdae-2bad-422f-9737-4b20c5960714    etcd           coreos.com/etcd:v2.0.10   sha512-c03b055d02e5    exited       2015-11-10 11:10:20.879 +0100 CET
2ded32e4-44ce-4e29-8434-09f3db276433    busybox        busybox:latest            sha512-77d0b085eaca    prepared     2015-11-10 12:33:23.902 +0100 CET
47c0d9c2-1fea-4a4b-bd1e-86d8a04cd1ee    busybox        busybox:latest            sha512-77d0b085eaca    running      2015-11-10 15:28:42.079 +0100 CET    default:ip4=172.16.28.91
# rkt status 2ded32e4
state=prepared
since=2015-11-10 12:33:23.902 +0100 CET

Fixes #1428
Fixes #1429

@krnowak
Copy link
Collaborator

krnowak commented Nov 10, 2015

Isn't modification timestamp propagated down the directory tree, so /var/lib/rkt/pods/*/<UUID> directory would end up with an "exited" timestamp after /var/lib/rkt/pods/*/<UUID>/stage1 is modified on exit?

@iaguis iaguis force-pushed the list-creation-exited-times branch from af1707e to 9142c92 Compare November 10, 2015 13:00
@iaguis
Copy link
Member Author

iaguis commented Nov 10, 2015

Isn't modification timestamp propagated down the directory tree, so /var/lib/rkt/pods// directory would end up with an "exited" timestamp after /var/lib/rkt/pods///stage1 is modified on exit?

AFAIK, the mtime of a directory changes when the files directly underneath change, but not when the "grandchildren" change.

@iaguis iaguis force-pushed the list-creation-exited-times branch from 9142c92 to 5f6ac7a Compare November 10, 2015 13:40
@iaguis
Copy link
Member Author

iaguis commented Nov 10, 2015

One annoying thing is that the word "WHEN" works for exited or prepared but doesn't for running, "SINCE" would make more sense.

Suggestions?

@jonboulle
Copy link
Contributor

SINCE seems reasonable to me.

@iaguis iaguis force-pushed the list-creation-exited-times branch from 5f6ac7a to 133fda8 Compare November 11, 2015 09:13
@iaguis
Copy link
Member Author

iaguis commented Nov 11, 2015

This is broken in KVM because it doesn't create any lock files in /var/lib/rkt/pods/<UUID>/stage1/.

@iaguis iaguis force-pushed the list-creation-exited-times branch from 133fda8 to 22e2712 Compare November 12, 2015 15:39
@iaguis
Copy link
Member Author

iaguis commented Nov 12, 2015

Added a patch to kvm to touch stage1/ on exit so the exit time detection works. Not particularly happy about it but it works.

@jonboulle
Copy link
Contributor

What happens in the case that kvm dies ungracefully?

On Thu, Nov 12, 2015, 08:03 Iago López Galeiras [email protected]
wrote:

Added a patch to kvm to touch stage1/ on exit so the exit time detection
works. Not particularly happy about it but it works.


Reply to this email directly or view it on GitHub
#1726 (comment).

@iaguis
Copy link
Member Author

iaguis commented Nov 12, 2015

What happens in the case that kvm dies ungracefully?

If you send SIGTERM or SIGKILL it doesn't work.

With nspawn, after sending SIGTERM things are ok but SIGKILL breaks the behavior.

Maybe we should just show creation time?

@iaguis
Copy link
Member Author

iaguis commented Nov 27, 2015

Suggestion from @vcaputo: #1789 (comment)

@alban alban modified the milestones: v0.14.0, v0.13.0 Dec 1, 2015
To get the pod preparation/creation time we use the modification time in
`/var/lib/rkt/pods/*/<UUID>`. It gets modified when the pod is prepared
and when the pod is created and doesn't change afterwards.

To get the pod exit time we use the modification time in
`/var/lib/rkt/pods/*/<UUID>/stage1`. The reason is that systemd-nspawn
creates a lock file there, and removes it when the container exits (even
if it was killed).
@iaguis iaguis force-pushed the list-creation-exited-times branch from 22e2712 to 5793977 Compare December 4, 2015 17:39
@iaguis iaguis force-pushed the list-creation-exited-times branch from 5793977 to 73ab626 Compare December 4, 2015 17:49
@alban alban modified the milestones: v0.16.0, v0.15.0 Jan 8, 2016
@alban alban modified the milestones: v1.0.0, v0.16.0 Jan 20, 2016
@iaguis
Copy link
Member Author

iaguis commented Jan 25, 2016

Since we can't think of a reliable way to get the exited times and we're fine for now with created/start times, I'm closing this in favor of #2030

@iaguis iaguis closed this Jan 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants