Fix aiohttp Socket Mode close lifecycle#1914
Open
xero-aiescape wants to merge 1 commit into
Open
Conversation
|
Thanks for the contribution! Before we can merge this, we need @xero-aiescape to sign the Salesforce Inc. Contributor License Agreement. |
Stop connect attempts once client shutdown begins, discard sessions that complete after close, and await cancellation of SDK-owned tasks before closing the aiohttp session.\n\nAdds lifecycle regressions for closed clients, close races, current-task ownership, backoff, and task/session cleanup.\n\nRefs slackapi#1913
5177d99 to
5650620
Compare
mwbrooks
reviewed
Jul 10, 2026
mwbrooks
left a comment
Member
There was a problem hiding this comment.
Hi @xero-aiescape, thanks for the PR! 🙇🏻
Before we can review your pull request, can you please sign the CLA? ✏️
Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the aiohttp Socket Mode shutdown race described in #1913.
connect()once client shutdown begins, including when close lands during an in-flight failed attemptClientSessionping_intervalbackoff, proxy, SSL, and live connection setup behaviorTesting
./scripts/run_tests.sh tests/slack_sdk_async/socket_mode/test_aiohttp.py— 10 passed./scripts/run_tests.sh tests/slack_sdk_async/socket_mode/— 18 passed before the final added close-success race; the final file and full CI-equivalent suite cover that addition.github/workflows/ci-build.ymlwith AWS host credentials/region removed — 984 passed, 5 skipped./scripts/run_mypy.sh --no-install— 106 source files clean./scripts/build_pypi_package.sh— sdist/wheel built andtwine checkpassedRed-before-green lifecycle coverage verifies:
ClientSessionping_intervalclose()does not return until all owned task cleanup settles and before the client session closesCategory
tests/integration_tests(Automated tests for this library)Requirements
Fixes #1913