-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bogus create_time in LXC containers #1344
Comments
Please try to be more clear about what the problem is and what you think psutil should do about it. Your bug report is a bit confusing. |
The problem is that in an LXC container, the One thing which is not virtualized is the |
Actually, there's already a comment about this here: https://github.com/giampaolo/psutil/blob/master/psutil/_psutil_linux.c#L262 |
Clear. Sounds reasonable. |
You mentioned lxc/lxcfs#164, but it says there that they reverted btime virtualization in /proc/stat for exactly this reason (reverted in lxc/lxcfs@72dd97f). Only LXC 2.0.7 seems to be affected by incorrect btime. |
Right, I digged a bit deeper and found that in the meantime as well. Problem is that 2.0.7 got shipped in Debian stable (and so far has not been fixed, although I am working on it), so maybe it is still worth fixing? But it's true that this needs some backtracking. |
The patroni acceptance tests fail under LXC cause patroni checks the (process start) timestamp in a pid file against
self.create_time
, and the latter is reported as several days in the future (note that the two timestamps are swapped by error, I opened an issue for that):Some digging and the fact that the autopkgtest on ci.debian.net is run in LXC containers turned up lxc/lxcfs#164 ("btime is not virtualized in /proc/stat") which sure sounds like the culprit, i.e. the
btime
thatcreate_time
uses as boot time/uptime for process creation time computation in https://github.com/giampaolo/psutil/blob/master/psutil/_pslinux.py#L1631 is bogus in this case.The text was updated successfully, but these errors were encountered: