-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Keep the monitor exits from stopping when the watcher gets error #8195
Conversation
Hi @bitoku. Thanks for your PR. I'm waiting for a cri-o member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8195 +/- ##
==========================================
+ Coverage 49.54% 49.55% +0.01%
==========================================
Files 153 153
Lines 16961 16955 -6
==========================================
- Hits 8403 8402 -1
+ Misses 7511 7505 -6
- Partials 1047 1048 +1 |
/ok-to-test |
/retest |
server/server.go
Outdated
@@ -781,11 +781,6 @@ func (s *Server) monitorExits(ctx context.Context, watcher *fsnotify.Watcher, do | |||
go s.handleExit(ctx, event) | |||
case err := <-watcher.Errors: | |||
log.Debugf(ctx, "Watch error: %v", err) |
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.
can we make this Errorf
so it is easier to see there's an issue?
one note, otherwise LGTM. good idea here @bitoku |
Signed-off-by: Ayato Tokubi <[email protected]>
180d015
to
7fec7bf
Compare
/approve |
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bitoku, haircommander, kwilczynski 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 |
/test ci-cgroupv2-integration |
/cherry-pick release-1.30 |
/cherry-pick release-1.29 |
@kwilczynski: new pull request created: #8209 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-sigs/prow repository. |
@kwilczynski: new pull request created: #8210 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-sigs/prow repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Currently when the watcher in "exit monitor" gets an error, whole "exit monitor" stops and it is never restarted again.
In other words, if the watcher gets an error, cri-o continues to work but it can no longer watch exits.
Watcher errors (= errors in
fsnotify
) are supposed to be something recoverable, and thereforefsnotify
doesn't stop if it gets an error (see the usage ofsendError
in the codes below).https://github.com/fsnotify/fsnotify/blob/main/backend_inotify.go#L410-L573
https://github.com/fsnotify/fsnotify/blob/main/backend_windows.go#L483-L647
This PR keeps the monitor from stopping when the watcher gets error, and makes it keep monitoring.
It also fixes
close of closed channel
when cri-o shuts down. (#8031)Which issue(s) this PR fixes:
Fixes #8031
Special notes for your reviewer:
Even if this PR is merged, there is slight possibility that some events are ignored when it gets an error although it will be able to much more events than the current behaviour.
Does this PR introduce a user-facing change?