Skip to content

Conversation

@patchback
Copy link
Contributor

@patchback patchback bot commented Jun 12, 2025

This is a backport of PR #11198 as merged into 3.13 (b151d3f).

What do these changes do?

This PR restores the loop parameter that was accidentally removed from the TCPConnector instantiation in ClientSession when PR #11095 was merged. When a ClientSession is created without an explicit connector, it auto-creates a TCPConnector. This connector should use the same event loop as the session to maintain consistency.

Are there changes in behavior for the user?

No behavior changes for users. This is a bug fix that restores the previous correct behavior where the auto-created TCPConnector uses the same event loop as the ClientSession.

Is it a substantial burden for the maintainers to support this?

No, this is a simple one-line fix that restores a parameter that was accidentally removed. The pattern of passing the loop parameter to connectors is well-established throughout the codebase and is already tested. This change adds minimal maintenance burden and includes a test to prevent regression.

Related issue number

Fixes #11147

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES/ folder
    • name it <issue_or_pr_num>.<type>.rst (e.g. 588.bugfix.rst)

    • if you don't have an issue number, change it to the pull request
      number after creating the PR

      • .bugfix: A bug fix for something the maintainers deemed an
        improper undesired behavior that got corrected to match
        pre-agreed expectations.
      • .feature: A new behavior, public APIs. That sort of stuff.
      • .deprecation: A declaration of future API removals and breaking
        changes in behavior.
      • .breaking: When something public is removed in a breaking way.
        Could be deprecated in an earlier release.
      • .doc: Notable updates to the documentation structure or build
        process.
      • .packaging: Notes for downstreams about unobvious side effects
        and tooling. Changes in the test invocation considerations and
        runtime assumptions.
      • .contrib: Stuff that affects the contributor experience. e.g.
        Running tests, building the docs, setting up the development
        environment.
      • .misc: Changes that are hard to assign to any of the above
        categories.
    • Make sure to use full sentences with correct case and punctuation,
      for example:

      Fixed issue with non-ascii contents in doctest text files
      -- by :user:`contributor-gh-handle`.

      Use the past tense or the present tense a non-imperative mood,
      referring to what's changed compared to the last released version
      of this project.

@patchback patchback bot requested review from asvetlov and webknjaz as code owners June 12, 2025 21:21
@bdraco bdraco changed the title [PR #11198/b151d3fc backport][3.12] [3.13] Fix auto-created TCPConnector not using session's event loop [PR #11198/b151d3fc backport][3.12] Fix auto-created TCPConnector not using session's event loop Jun 12, 2025
@bdraco bdraco enabled auto-merge (squash) June 12, 2025 21:21
@codspeed-hq
Copy link

codspeed-hq bot commented Jun 12, 2025

CodSpeed Performance Report

Merging #11199 will not alter performance

Comparing patchback/backports/3.12/b151d3fce4d96aba7209bcaba0ec0690c793920e/pr-11198 (a5993ac) with 3.12 (bd374b1)

Summary

✅ 59 untouched benchmarks

@codecov
Copy link

codecov bot commented Jun 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.28%. Comparing base (bd374b1) to head (a5993ac).
⚠️ Report is 60 commits behind head on 3.12.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             3.12   #11199      +/-   ##
==========================================
- Coverage   98.31%   98.28%   -0.03%     
==========================================
  Files         132      132              
  Lines       43499    43506       +7     
  Branches     2380     2380              
==========================================
- Hits        42765    42760       -5     
- Misses        558      567       +9     
- Partials      176      179       +3     
Flag Coverage Δ
CI-GHA 98.18% <100.00%> (-0.03%) ⬇️
OS-Linux 97.88% <100.00%> (-0.08%) ⬇️
OS-Windows 95.66% <100.00%> (+<0.01%) ⬆️
OS-macOS 97.20% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 96.84% <100.00%> (+<0.01%) ⬆️
Py-3.10.18 96.77% <100.00%> (-0.57%) ⬇️
Py-3.11.13 97.52% <100.00%> (-0.01%) ⬇️
Py-3.11.9 95.24% <100.00%> (+<0.01%) ⬆️
Py-3.12.10 97.13% <100.00%> (+1.79%) ⬆️
Py-3.12.11 97.06% <100.00%> (-0.57%) ⬇️
Py-3.13.3 97.29% <100.00%> (-0.57%) ⬇️
Py-3.9.13 96.74% <100.00%> (+<0.01%) ⬆️
Py-3.9.23 ?
Py-pypy7.3.16 ?
VM-macos 97.20% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 97.88% <100.00%> (-0.08%) ⬇️
VM-windows 95.66% <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.

@bdraco bdraco merged commit fc9b720 into 3.12 Jun 12, 2025
36 checks passed
@bdraco bdraco deleted the patchback/backports/3.12/b151d3fce4d96aba7209bcaba0ec0690c793920e/pr-11198 branch June 12, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants