Skip to content

Conversation

@cepedus
Copy link

@cepedus cepedus commented Aug 30, 2025

Description of Change

Once an AioBaseClient is used as a context manager and exits, forbid any following attempt to create a new session.

If AioBaseClient is never used as a context manager, this restriction does not apply.

Assumptions

Checklist for All Submissions

  • I have added change info to CHANGES.rst
  • If this is resolving an issue (needed so future developers can determine if change is still necessary and under what conditions) (can be provided via link to issue with these details): Closed client can create non-contextualized connections #1398
    • Detailed description of issue
    • Alternative methods considered (if any)
    • How issue is being resolved
    • How issue can be reproduced
  • If this is providing a new feature (can be provided via link to issue with these details):
    • Detailed description of new feature
    • Why needed
    • Alternatives methods considered (if any)

Checklist when updating botocore and/or aiohttp versions

(not applicable)

@jakob-keller jakob-keller added the bug Something isn't working label Aug 30, 2025
@cepedus cepedus force-pushed the forbid-new-connections-once-aexited branch from 7f25d08 to f8b59ce Compare August 31, 2025 09:25
@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.58%. Comparing base (0dd027c) to head (1c52a86).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1402      +/-   ##
==========================================
+ Coverage   91.39%   91.58%   +0.18%     
==========================================
  Files          74       74              
  Lines        7855     7864       +9     
==========================================
+ Hits         7179     7202      +23     
+ Misses        676      662      -14     
Flag Coverage Δ
no-httpx 90.02% <100.00%> (+0.04%) ⬆️
os-ubuntu-24.04 91.50% <100.00%> (+0.11%) ⬆️
os-ubuntu-24.04-arm 91.32% <100.00%> (+0.18%) ⬆️
python-3.10 91.15% <100.00%> (+0.04%) ⬆️
python-3.11 91.22% <100.00%> (+0.11%) ⬆️
python-3.12 91.22% <100.00%> (+0.11%) ⬆️
python-3.13 91.15% <100.00%> (+0.04%) ⬆️
python-3.14 91.48% <100.00%> (+0.12%) ⬆️
python-3.9 91.24% <100.00%> (+0.12%) ⬆️
unittests 91.58% <100.00%> (+0.18%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

thehesiod
thehesiod previously approved these changes Sep 9, 2025
@thehesiod
Copy link
Collaborator

@cepedus you'll need to sign and force push the commits

Copy link
Collaborator

@jakob-keller jakob-keller left a comment

Choose a reason for hiding this comment

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

As I understand it, this PR enforces using AIOHTTPSession as an asynchronous context manager, which was strongly recommended, but optional before. IMO, this might need to be considered a breaking change. Any thoughts? Why is the current situation problematic again?

@cepedus cepedus force-pushed the forbid-new-connections-once-aexited branch from b904ba1 to fe9084f Compare September 13, 2025 09:52
@cepedus
Copy link
Author

cepedus commented Sep 13, 2025

@jakob-keller The current behavior is prone to loose sessions that are potentially never closed in the default use-case (RuntimeError potential down the stream if the loop is closed). I agree this could mean a breaking change to those users, which version should I put then?

@thehesiod I signed all commmits, review was dismissed though

@cepedus
Copy link
Author

cepedus commented Oct 1, 2025

Up, should I continue this MR?

@thehesiod
Copy link
Collaborator

@cepedus sorry about delay, been sick. Lets do a major bump to obey semver rules, and merge this puppy

…ons-once-aexited

# Conflicts:
#	CHANGES.rst
#	aiobotocore/__init__.py
@cepedus
Copy link
Author

cepedus commented Oct 18, 2025

Bumped major + updated branch :)

@jakob-keller jakob-keller added this to the Release 3.0.0 milestone Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants