Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jsbronder
Copy link

@jsbronder jsbronder commented Jun 12, 2025

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.

@bedevere-app
Copy link

bedevere-app bot commented Jun 12, 2025

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 skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Jun 12, 2025

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 skip news label instead.

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.
jsbronder added a commit to jsbronder/asyncio-dgram that referenced this pull request Jul 7, 2025
Accounting in asyncio.DatagramTransport is broken, so this won't pass.
python/cpython#135444
python/cpython#135445
jsbronder added a commit to jsbronder/asyncio-dgram that referenced this pull request Jul 7, 2025
Accounting in asyncio.DatagramTransport is broken, so this won't pass.
python/cpython#135444
python/cpython#135445
@kumaraditya303 kumaraditya303 added type-bug An unexpected behavior, bug, or error topic-asyncio needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jul 26, 2025
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# 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

Comment on lines +1 to +2
Fix asyncio DatagramTransport flow control accounting when a packet cannot
be immediately sent.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes topic-asyncio type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy