-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
gh-123557: Limit the reading size from Unix sockets to same limit pipes use #123558
Conversation
…e-smaller-socket-buffer
Feature smaller socket buffer
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
See #123559. It is much simpler. |
Issue: #123557