Skip to content

[3.11] Fix WebSocket reader flow control size calculation for multi-byte data#9686

Merged
bdraco merged 5 commits into
3.11from
multi_byte_flow_control_fix_311
Nov 7, 2024
Merged

[3.11] Fix WebSocket reader flow control size calculation for multi-byte data#9686
bdraco merged 5 commits into
3.11from
multi_byte_flow_control_fix_311

Conversation

@bdraco

@bdraco bdraco commented Nov 6, 2024

Copy link
Copy Markdown
Member

The decoded size was passed to the FlowControlDataQueue instead of the bytes size which meant multi-byte characters would be under counted.

Note that this code is completely different on 3.11/3.10 than master so this PR is directly to 3.11

@codspeed-hq

codspeed-hq Bot commented Nov 6, 2024

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #9686 will not alter performance

Comparing multi_byte_flow_control_fix_311 (3eb8a69) with 3.11 (685768a)

Summary

✅ 14 untouched benchmarks

@codecov

codecov Bot commented Nov 6, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.92%. Comparing base (685768a) to head (3eb8a69).
Report is 230 commits behind head on 3.11.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             3.11    #9686   +/-   ##
=======================================
  Coverage   97.92%   97.92%           
=======================================
  Files         117      117           
  Lines       35845    35844    -1     
  Branches     4295     4294    -1     
=======================================
  Hits        35101    35101           
+ Misses        558      557    -1     
  Partials      186      186           
Flag Coverage Δ
CI-GHA 97.81% <100.00%> (+<0.01%) ⬆️
OS-Linux 97.50% <100.00%> (+<0.01%) ⬆️
OS-Windows 94.42% <100.00%> (+<0.01%) ⬆️
OS-macOS 96.72% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 96.57% <100.00%> (+<0.01%) ⬆️
Py-3.10.15 97.00% <100.00%> (+<0.01%) ⬆️
Py-3.11.10 97.06% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 96.65% <100.00%> (+<0.01%) ⬆️
Py-3.12.7 97.54% <100.00%> (+<0.01%) ⬆️
Py-3.13.0 97.52% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 96.50% <100.00%> (+<0.01%) ⬆️
Py-3.9.20 96.93% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.16 96.53% <100.00%> (-0.01%) ⬇️
VM-macos 96.72% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 97.50% <100.00%> (+<0.01%) ⬆️
VM-windows 94.42% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Nov 6, 2024
@bdraco

bdraco commented Nov 6, 2024

Copy link
Copy Markdown
Member Author

https://www.merriam-webster.com/dictionary/undercount

Hmm.. guess its not in the spelling words

…yte data

The decoded size was passed to the FlowControlDataQueue instead of the
bytes size which meant multi-byte characters would be counted incorrectly
@bdraco bdraco force-pushed the multi_byte_flow_control_fix_311 branch from a11bc73 to 03480f2 Compare November 7, 2024 17:03
@bdraco bdraco marked this pull request as ready for review November 7, 2024 18:35
@bdraco bdraco merged commit ea1c084 into 3.11 Nov 7, 2024
@bdraco bdraco deleted the multi_byte_flow_control_fix_311 branch November 7, 2024 19:18
@patchback

patchback Bot commented Nov 7, 2024

Copy link
Copy Markdown
Contributor

Backport to 3.10: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply ea1c084 on top of patchback/backports/3.10/ea1c084d9f49e91feb2e92fea307260ad3f47376/pr-9686

Backporting merged PR #9686 into 3.11

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/aio-libs/aiohttp.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/3.10/ea1c084d9f49e91feb2e92fea307260ad3f47376/pr-9686 upstream/3.10
  4. Now, cherry-pick PR [3.11] Fix WebSocket reader flow control size calculation for multi-byte data #9686 contents into that branch:
    $ git cherry-pick -x ea1c084d9f49e91feb2e92fea307260ad3f47376
    If it'll yell at you with something like fatal: Commit ea1c084d9f49e91feb2e92fea307260ad3f47376 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x ea1c084d9f49e91feb2e92fea307260ad3f47376
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR [3.11] Fix WebSocket reader flow control size calculation for multi-byte data #9686 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.10/ea1c084d9f49e91feb2e92fea307260ad3f47376/pr-9686
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

bdraco added a commit that referenced this pull request Nov 7, 2024
bdraco added a commit that referenced this pull request Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant