Opened 13 months ago
Closed 13 months ago
#18539 closed bug (fixed)
send(2) with AF_UNIX SOCK_DGRAM blocks upon full send buffer; MSG_NOWAIT ignored
Reported by: | kohlschuetter | Owned by: | axeld |
---|---|---|---|
Priority: | critical | Milestone: | R1/beta5 |
Component: | Network & Internet/UDP | Version: | R1/beta4 |
Keywords: | hang | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
When sending datagrams via AF_UNIX, a buffer-full condition prevents "send" from returning immediately with an error, even when MSG_NOWAIT is set.
For comparison, macOS always returns with errno=ENOBUFS in that situation, regardless whether MSG_NOWAIT was set or not. Linux returns with "EAGAIN" only with MSG_NOWAIT set, blocking if not.
This prevents code relying on these features from working as expected.
A workaround is to define a send timeout on the socket, however that may be brittle when receiving an existing socket via file descriptors, for example.
Attachments (1)
Change History (3)
by , 13 months ago
Attachment: | sendtest.c added |
---|
comment:2 by , 13 months ago
Milestone: | Unscheduled → R1/beta5 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Committed in hrev57200
Example code demonstrating the bug