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

gh-123557: Limit the reading size from Unix sockets to same limit pipes use #123558

Conversation

aplaikner
Copy link
Contributor

@aplaikner aplaikner commented Sep 1, 2024

@methane methane self-requested a review September 1, 2024 07:02
if size > self._default_pipe_size > 0:
mode = os.fstat(handle).st_mode
is_pipe = stat.S_ISFIFO(mode)
limit = self._default_pipe_size if is_pipe else remaining
is_socket = stat.S_ISSOCK(mode)
limit = self._default_pipe_size if is_pipe or is_socket else remaining
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about use the limit for all connection, instead of socket and pipe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are no performance drawbacks for other types of connections, then it's a solid solution. I've only analyzed pipes and sockets.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know connection other than pipe and socket.
But mmap+mremap+munmap overhead is very common issue for all streams.
So using chunked read by default and override it in special connection class seems better solution.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about updating Misc/NEWS.d/next/C API/2024-07-03-10-11-53.gh-issue-121313.D7gARW.rst instead of adding new changelog?
Changelog is part of Python documentation. It should be readable than commitlog for Python users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was prompted by the blurp it bot to create a summary of the changes via the separate website.

@methane
Copy link
Member

methane commented Sep 1, 2024

See #123559. It is much simpler.

@methane methane closed this Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants