-
Notifications
You must be signed in to change notification settings - Fork 68
Fix GrpcWrapperAsyncIO.close for OpenTelemetry intercepted streams #684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -198,7 +198,12 @@ async def start(self, driver: SupportedDriverType, stub: Any, method: str) -> No | |
| def close(self) -> None: | ||
| self.from_client_grpc.put_nowait(_stop_grpc_connection_marker) | ||
| if self._stream_call: | ||
| self._stream_call.cancel() | ||
| if hasattr(self._stream_call, "cancel"): | ||
| # for ordinal grpc calls | ||
| self._stream_call.cancel() | ||
| elif hasattr(self._stream_call, "close"): | ||
| # for OpenTelemetry intercepted grpc calls (generator) | ||
| self._stream_call.close() | ||
|
Comment on lines
198
to
+206
|
||
|
|
||
| self._clean_executor(wait=True) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment says "ordinal grpc calls"; "ordinal" is a spelling/word-choice error here (it means positional/ranked). Consider changing it to "ordinary" or "regular" to avoid confusion.