-
Notifications
You must be signed in to change notification settings - Fork 1.1k
oci: parse stat file instead of using ctime #4146
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
oci: parse stat file instead of using ctime #4146
Conversation
331c377 to
b8207b6
Compare
|
@kolyshkin ptal |
Codecov Report
@@ Coverage Diff @@
## master #4146 +/- ##
==========================================
+ Coverage 40.76% 40.83% +0.06%
==========================================
Files 111 111
Lines 9494 9505 +11
==========================================
+ Hits 3870 3881 +11
Misses 5248 5248
Partials 376 376 |
|
LGTM once Kir's comment is addressed and the tests get happy. |
c022a16 to
715b765
Compare
|
/retest |
|
/retest |
|
/cherry-pick release-1.19 |
|
@haircommander: once the present PR merges, I will cherry-pick it on top of release-1.19 in a new PR and assign it to you. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/retest |
715b765 to
fd4835b
Compare
|
updated as suggested and added unit tests |
|
/retest |
|
@haircommander: once the present PR merges, I will cherry-pick it on top of release-1.19 in a new PR and assign it to you. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
internal/oci/container.go
Outdated
| // trim from the beginning to the character after the last space | ||
| data = data[iter+1:] | ||
| // find the next space | ||
| iter = bytes.IndexRune(data, ' ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use IndexRune here as we do not expect any Unicode in the input.
|
Looks much better now, just a nit about using |
or, yet better, |
saschagrunert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit, otherwise LGTM
2bdeb5d to
1efb30f
Compare
as we have seen the ctime of it's proc entry fluctuate, and the process start time (item 22 in /proc/pid/stat) could be more reliable Signed-off-by: Peter Hunt <[email protected]>
1efb30f to
167fed4
Compare
|
One question |
|
/retest |
1 similar comment
|
/retest |
saschagrunert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
kolyshkin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, kolyshkin, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
|
/retest |
1 similar comment
|
/retest |
|
/test integration_rhel |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
@haircommander: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/retest |
|
@haircommander: #4146 failed to apply on top of branch "release-1.19": DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Peter Hunt [email protected]
What type of PR is this?
/kind bug
What this PR does / why we need it:
as we have seen the ctime of it's proc entry fluctuate, and the process start time (item 22 in /proc/pid/stat)
could be more reliable
this removes superfluous log lines like this:
0e06ea75835a28aee51b37751e51c6a6f4ac5a54fbe5b805d13c9184c075b74b: PID 3240 is running but has start time of 1598893538, whereas the saved start time is 1598893381. PID wrap may have occurred"Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?