Repository navigation
fix(socket_mode): only release connect_operation_lock when send_message holds it - #2048
Merged
WilliamBergamin merged 3 commits intoNov 16, 2026
Conversation
…etries Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…ge holds it Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2048 +/- ##
==========================================
- Coverage 84.51% 84.49% -0.03%
==========================================
Files 118 118
Lines 14042 14037 -5
==========================================
- Hits 11868 11860 -8
- Misses 2174 2177 +3 ☔ View full report in Codecov by Harness. |
WilliamBergamin
marked this pull request as ready for review
November 16, 2026 21:52
zimeg
approved these changes
Nov 16, 2026
zimeg
left a comment
Member
There was a problem hiding this comment.
🐍 @WilliamBergamin LGTM! Matching the sync clients with async with reads so much safer, and thanks for carrying this one forward from #1963!
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
This pull request stops the async Socket Mode adapters from releasing a
connect_operation_lockthatsend_messagedoesn't hold.send_messagenever acquired the lock, but itsfinallyreleased it whenever it was locked. A send that failed during a reconnect released the reconnect's lock.send_messagewas cancelled while it waited on the lock, thefinallystill saw it as locked and released the lock for the task that held it.async with self.connect_operation_lock:, so a release only ever follows the acquire.Supersedes #1963. Thanks @dylanpulver for finding and reporting this. This is a separate implementation, because #1963 couldn't be merged without a signed CLA.
Testing
The new tests fail on
mainand pass on this branch, for both adapters:send_messageretries and times out waiting on the lock.Category
/docs(Documents)/tutorial(PythOnBoardingBot tutorial)tests/integration_tests(Automated tests for this library)Requirements
python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.shafter making the changes.🤖 Generated with Claude Code