mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Don't eat error from epoll_ctl EPOLL_CTL_ADD
Docker maps stdin to `/dev/null` which doesn't support epoll. Host FD was ignoring the error and suceeding the epoll_ctl call from the container, giving false impressing that epoll would be notified. This required plumbing failure to all waiter.Waitable.EventRegister callers and implementers. Closes #6795 PiperOrigin-RevId: 414797621
This commit is contained in:
committed by
gVisor bot
parent
d62190f8b5
commit
9768009a79
@@ -907,18 +907,24 @@ func (f *fileDescription) ConfigureMMap(_ context.Context, opts *memmap.MMapOpts
|
||||
}
|
||||
|
||||
// EventRegister implements waiter.Waitable.EventRegister.
|
||||
func (f *fileDescription) EventRegister(e *waiter.Entry) {
|
||||
func (f *fileDescription) EventRegister(e *waiter.Entry) error {
|
||||
f.inode.queue.EventRegister(e)
|
||||
if f.inode.mayBlock {
|
||||
fdnotifier.UpdateFD(int32(f.inode.hostFD))
|
||||
if err := fdnotifier.UpdateFD(int32(f.inode.hostFD)); err != nil {
|
||||
f.inode.queue.EventUnregister(e)
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// EventUnregister implements waiter.Waitable.EventUnregister.
|
||||
func (f *fileDescription) EventUnregister(e *waiter.Entry) {
|
||||
f.inode.queue.EventUnregister(e)
|
||||
if f.inode.mayBlock {
|
||||
fdnotifier.UpdateFD(int32(f.inode.hostFD))
|
||||
if err := fdnotifier.UpdateFD(int32(f.inode.hostFD)); err != nil {
|
||||
panic(fmt.Sprint("UpdateFD:", err))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user