-
Notifications
You must be signed in to change notification settings - Fork 1.1k
oci: wait until pidfile to be written before starting timer #5067
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: wait until pidfile to be written before starting timer #5067
Conversation
/cherry-pick release-1.21 |
@haircommander: once the present PR merges, I will cherry-pick it on top of release-1.21 in a new PR and assign it to you. In 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. |
/cherry-pick release-1.20 |
@haircommander: once the present PR merges, I will cherry-pick it on top of release-1.20 in a new PR and assign it to you. In 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. |
/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. In 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. |
Codecov Report
@@ Coverage Diff @@
## master #5067 +/- ##
==========================================
+ Coverage 40.15% 43.93% +3.78%
==========================================
Files 115 109 -6
Lines 9317 11349 +2032
==========================================
+ Hits 3741 4986 +1245
- Misses 5157 5888 +731
- Partials 419 475 +56 |
9cfabcf
to
509b8ca
Compare
509b8ca
to
efc0f2c
Compare
utils/notify.go
Outdated
} | ||
go func() { | ||
defer notify.Stop(c) | ||
for { |
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.
S1000: should use for range instead of for { select {} }
(at-me in a reply with help
or ignore
)
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.
u right
efc0f2c
to
3268e5e
Compare
I've opted to move to github.com/rjeczalik/notify instead of fsnotify, partially because it seems more active, and also because I was having trouble with the unit tests and the accuracy of the cross-platform events. As a result of the new package, I have been able to shave off another ~30 ms, leaving the runc overhead at about 4ms on my machine, as opposed to 50 ms before this PR |
I also had the idea to test what the behavior was like when conmon was running execs. turns out, conmon was very generous to container processes--giving somewhere between 40ms and 50ms over the timeout: in other words, this PR changes us from giving 100ms less from pre-conmonless-exec days to about 50ms less. BUT we are technically closer to the actual time the container process is execing |
c0651c0
to
a484419
Compare
/retest |
a484419
to
726b951
Compare
dropping a484419 for now to see if that broke stuff |
/retest-required |
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.
Generally LGTM, just a few nits
internal/oci/runtime_oci.go
Outdated
return filepath.Join(c.bundlePath, "conmon-pidfile") | ||
} | ||
|
||
func WatchForFile(ctx context.Context, path string, opsToWatch []notify.Event) chan error { |
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.
this function can be private
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.
not if we want to unit test it, right?
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.
Uh, yeah right.
internal/oci/runtime_oci.go
Outdated
return filepath.Join(c.bundlePath, "conmon-pidfile") | ||
} | ||
|
||
func WatchForFile(ctx context.Context, path string, opsToWatch []notify.Event) chan error { |
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.
func WatchForFile(ctx context.Context, path string, opsToWatch []notify.Event) chan error { | |
func WatchForFile(ctx context.Context, path string, opsToWatch ...notify.Event) chan error { |
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.
todo ctx is unused
internal/oci/runtime_oci.go
Outdated
go func() { | ||
defer notify.Stop(c) | ||
for ei := range c { | ||
fmt.Println(ei) |
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.
todo gotta drop this
4454e34
to
85aa875
Compare
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
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
quay flake |
/retest |
Signed-off-by: Peter Hunt <pehunt@redhat.com>
to be more reusable Signed-off-by: Peter Hunt <pehunt@redhat.com>
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Be careful about leaking anything Signed-off-by: Peter Hunt <pehunt@redhat.com>
85aa875
to
2297dba
Compare
I dropped the bats test, because it was flaky, and I added some code to make sure we're not leaking channels or routines. |
/retest |
@haircommander: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
/lgtm |
@haircommander: #5067 failed to apply on top of branch "release-1.21":
In 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. |
@haircommander: #5067 failed to apply on top of branch "release-1.20":
In 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. |
@haircommander: #5067 failed to apply on top of branch "release-1.19":
In 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. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
We want a way to judging how long the actual exec process is running in a container, to be totally fair in how we account for the exec. Unfortunately, there is not a great signal other than pid file creation (which still is a bit early). This improves the time the actual container process gets for exec by about 10ms
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?