Page MenuHomeFreeBSD

unix/dgram: return EAGAIN instead of ENOBUFS when O_NONBLOCK set
ClosedPublic

Authored by glebius on Feb 6 2022, 6:33 PM.
Tags
None
Referenced Files
F163348367: D34187.id102434.diff
Wed, Jul 22, 9:27 AM
Unknown Object (File)
Tue, Jul 21, 8:47 AM
Unknown Object (File)
Tue, Jul 21, 5:15 AM
Unknown Object (File)
Mon, Jul 20, 1:24 AM
Unknown Object (File)
Sat, Jul 18, 4:03 PM
Unknown Object (File)
Mon, Jul 13, 9:25 AM
Unknown Object (File)
Apr 30 2026, 10:58 PM
Unknown Object (File)
Apr 27 2026, 7:19 PM
Subscribers

Details

Summary

This is behavior what some programs expect and what Linux does. For
example nginx expects EAGAIN when sending messages to /var/run/log,
which it connects to with O_NONBLOCK. Particularly with nginx the
problem is magnified by the fact that a ENOBUFS on send(2) is also
logged, so situation creates a log-bomb - a failed log message
triggers another log message.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44310
Build 41198: arc lint + arc unit

Event Timeline

I think this is probably ok. EAGAIN is the usual error value for this case. I thought this would break our syslog(3), which explicitly checks for ENOBUFS, but it uses a blocking socket.

This revision is now accepted and ready to land.Feb 6 2022, 10:35 PM