Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure console socket buffers are properly sized #435

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

dfr
Copy link
Contributor

@dfr dfr commented Jul 6, 2023

On FreeBSD, the default socket buffer size for unix domain sockets is just 8192 which is too small for largest message used on the console socket which is 8193. This causes output for processes which emit large amounts of data to be lost on FreeBSD (for an example, see podman's 'podman exec/run - missing output' system test).

To avoid the problem, this commit increases the buffer sizes to CONN_SOCK_BUF_SIZE (32768) which allows for several max-sized messages to be in-flight.

@dfr
Copy link
Contributor Author

dfr commented Jul 6, 2023

GIven that this is not a problem on Linux which defaults to much larger buffers, the calls to setsockopt could be made conditional for FreeBSD builds.

@haircommander
Copy link
Collaborator

GIven that this is not a problem on Linux which defaults to much larger buffers, the calls to setsockopt could be made conditional for FreeBSD builds.

yeah I think I would prefer that

@dfr dfr force-pushed the freebsd-console-buffers branch from a3e4419 to 386d23b Compare July 7, 2023 08:59
@dfr
Copy link
Contributor Author

dfr commented Jul 7, 2023

This iteration factors out setting the socket buffers and makes it a no-op on Linux.

On FreeBSD, the default socket buffer size for unix domain sockets is
just 8192 which is too small for largest message used on the console
socket which is 8193.  This causes output for processes which emit large
amounts of data to be lost on FreeBSD (for an example, see podman's
'podman exec/run - missing output' system test).

To avoid the problem, this commit increases the buffer sizes to
CONN_SOCK_BUF_SIZE (32768) which allows for several max-sized messages
to be in-flight.

Signed-off-by: Doug Rabson <[email protected]>
@dfr dfr force-pushed the freebsd-console-buffers branch from 386d23b to fa67ce6 Compare July 7, 2023 10:47
@rhatdan
Copy link
Member

rhatdan commented Jul 10, 2023

LGTM
@giuseppe @haircommander PTAL

@haircommander
Copy link
Collaborator

LGTM

1 similar comment
@giuseppe
Copy link
Member

LGTM

@rhatdan rhatdan merged commit 75f8ceb into containers:main Jul 11, 2023
16 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants