-
Notifications
You must be signed in to change notification settings - Fork 20
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
uevent: should respawn the uevent monitor #76
uevent: should respawn the uevent monitor #76
Conversation
3126b4e
to
f70cfc9
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.
I found two small typos, other than that it looks fine (i.e. logic seems sensible).
I was going to say that the thing I don't understand is why it terminates in the first place if there's an error (our code has an infinite loop, right?) but then I went looking at
node-disk-manager/vendor/github.com/pilebones/go-udev/netlink/conn.go
Lines 168 to 175 in 44f601c
default: | |
_, buf, err := c.msgPeek() | |
if err != nil { | |
errs <- fmt.Errorf("Unable to check available uevent, err: %w", err) | |
break loop // stop iteration in case of error | |
} | |
bufToRead <- buf | |
} |
Monitor
will just stop if there's any kind of error.
Hi @tserong, thanks for the review!
As you read the So that is why we need to respawn it (means creating a new monitor for incoming udev event) |
- NDM could not work w/o uevent monitor - add `inject-udev-monitor-error` for testing - Inject udev monitor error with CI Signed-off-by: Vicente Cheng <[email protected]>
f70cfc9
to
3fb8b9f
Compare
@Mergifyio backport v0.6.x |
✅ Backports have been created
|
@Mergifyio backport v0.5.x |
✅ Backports have been created
|
Problem:
The udev monitor will not work with any errors.
Solution:
We monitor the error and try to respawn it.
Related Issue:
harvester/harvester#4925
Test plan:
Because the original error is hard to reproduce, I added another inject error here.
inject-udev-monitor-error
as true.