-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-135444: fix DatagramTransport buffer_size accounting #135445
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
base: main
Are you sure you want to change the base?
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
04c6560
to
8a8f749
Compare
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Commit 73e8637 added 8 to the buffer_size when send could not be called right away. However, it did not complete this accounting by removing 8 from the buffer size when sending did finally complete.
8a8f749
to
860cec6
Compare
Accounting in asyncio.DatagramTransport is broken, so this won't pass. python/cpython#135444 python/cpython#135445
Accounting in asyncio.DatagramTransport is broken, so this won't pass. python/cpython#135444 python/cpython#135445
self.assertEqual(1, len(transport._buffer)) | ||
self.assertEqual(transport._buffer_size, len(data) + transport._header_size) | ||
|
||
# Now try to send the buffer and let it get requeued |
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.
# Now try to send the buffer and let it get requeued | |
# Now try to send the buffer, it will added to buffer again as if failed |
Fix asyncio DatagramTransport flow control accounting when a packet cannot | ||
be immediately sent. |
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.
Fix asyncio DatagramTransport flow control accounting when a packet cannot | |
be immediately sent. | |
Fix :meth:`asyncio.DatagramTransport.sendto` to account for datagram header size when data cannot be sent. |
Commit 73e8637 added 8 to the buffer_size when send could not be called right away. However, it did not complete this accounting by removing 8 from the buffer size when sending did finally complete.