Remove getattr calls in async transport closing#2928
Merged
adamtheturtle merged 2 commits intomainfrom Mar 27, 2026
Merged
Conversation
Add aclose to the AsyncTransport protocol and call it directly instead of using getattr to check for its existence. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The AsyncTransport protocol now requires aclose, so these tests for transports lacking aclose are no longer applicable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
acloseto theAsyncTransportprotocol so it's a required methodgetattr-based conditional closing with directawait self._transport.aclose()in all async clientsaclose, since the protocol now requires itTest plan
🤖 Generated with Claude Code
Note
Medium Risk
This is a small but potentially breaking API change for consumers providing custom async transports, which must now implement
aclose()or client cleanup will fail.Overview
Async client cleanup is simplified by removing conditional
getattrchecks and always callingawait self._transport.aclose()inAsyncVWS,AsyncCloudRecoService, andAsyncVuMarkService.AsyncTransportis tightened to require anaclose()method, and the test coverage for transports withoutacloseis removed accordingly.Written by Cursor Bugbot for commit 147f2ef. This will update automatically on new commits. Configure here.