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
Unknown Object (File)
Thu, Mar 27, 10:21 PM
Unknown Object (File)
Mon, Mar 17, 7:44 AM
Unknown Object (File)
Jan 28 2025, 10:15 PM
Unknown Object (File)
Jan 28 2025, 2:20 PM
Unknown Object (File)
Jan 23 2025, 6:45 PM
Unknown Object (File)
Jan 10 2025, 5:57 AM
Unknown Object (File)
Dec 17 2024, 11:37 AM
Unknown Object (File)
Dec 7 2024, 12:03 AM
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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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