Skip to content

Should we map ENOBUFS on macOS to WouldBlock? #2293

@thomaseizinger

Description

@thomaseizinger

We are seeing the following errors from the UDP socket on some installations on Mac OS:

Tunnel error: UDP socket failed: Failed to send datagram-batch with segment_size 1312 and total length 7872 to X.X.X.X:57689: No buffer space available (os error 55)

This appears to be the ENOBUFS error mentioned in the man page:

[ENOBUFS]         The system is unable to allocate an internal buffer.
                  The operation may succeed when buffers become avail-able. available.
                  able.

libc for Apple systems maps the error code 55 to this error: https://github.com/rust-lang/libc/blob/8e6f36c6ba5c91c150f2d79a06ffdc3d0b83a0f6/src/unix/bsd/apple/mod.rs#L2998

According to the Apple developer forum, this is a form of back-pressure and we should retry sending the packet when there are buffers available again.

I figured, we could do this in quinn-udp directly and map this error code on macOS to WouldBlock? Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions