You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Start would reset fd on HandleRead to blocking lead to set deadliner doesn't work #11
returnp.Add(desc.fd(), events, n, func(kevKevent) {
// Fd returns the integer Unix file descriptor referencing the open file.
// The file descriptor is valid only until f.Close is called or f is garbage collected.
// On Unix systems this will cause the SetDeadline methods to stop working.
func (f *File) Fd() uintptr {
if f == nil {
return ^(uintptr(0))
}
// If we put the file descriptor into nonblocking mode,
// then set it to blocking mode before we return it,
// because historically we have always returned a descriptor
// opened in blocking mode. The File will continue to work,
// but any blocking operation will tie up a thread.
if f.nonblock {
f.pfd.SetBlocking()
}
return uintptr(f.pfd.Sysfd)
}
This caused set deadliner doesn't work on conn owned by poller
Reacted by Axel Etcheverry, Roman, Yi Duan and mi4tin
My take is that calling File() on the socket is the root problem here.
I've forked this this library to use unix.Dup() + SyscallConn, and it has been working well at scale in production. Sharing in case anyone else runs into this. Its not a drop-in replacement, but changes are minor.
Activity
iamcalledrob commentedon Feb 11, 2026
I ran into this issue too.
My take is that calling
File()on the socket is the root problem here.I've forked this this library to use
unix.Dup()+SyscallConn, and it has been working well at scale in production. Sharing in case anyone else runs into this. Its not a drop-in replacement, but changes are minor.https://github.com/iamcalledrob/netpoll/