-
Notifications
You must be signed in to change notification settings - Fork 413
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
grpc integration causes exception with grpc.aio streaming #9139
Labels
Comments
This doesn't seem to be specific to dd-trace-py. I was able to replicate the issue with the following sample app which simply adds an async client interceptor to the repo mentioned above. In theory, this should work (unless I'm doing something wrong adding the client interceptor).
|
17 tasks
wconti27
added a commit
that referenced
this issue
May 15, 2024
This PR fixes a few issues with the `grpc aio` integration. Most notably, the integration was causing segfaults when wrapping async stream responses, most likely since these spans were never being finished. This issue was uncovered when customers upgraded their `google-api-core` dependencies to `2.17.0`; with this upgrade, the package changed many grpc calls to use async streaming. In addition to fixing the segfault, this PR also fixes the Pin object to be correctly placed on the grpcio module. Fixes #9139 ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
17 tasks
github-actions bot
pushed a commit
that referenced
this issue
May 15, 2024
This PR fixes a few issues with the `grpc aio` integration. Most notably, the integration was causing segfaults when wrapping async stream responses, most likely since these spans were never being finished. This issue was uncovered when customers upgraded their `google-api-core` dependencies to `2.17.0`; with this upgrade, the package changed many grpc calls to use async streaming. In addition to fixing the segfault, this PR also fixes the Pin object to be correctly placed on the grpcio module. Fixes #9139 ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) (cherry picked from commit 5897cab)
github-actions bot
pushed a commit
that referenced
this issue
May 15, 2024
This PR fixes a few issues with the `grpc aio` integration. Most notably, the integration was causing segfaults when wrapping async stream responses, most likely since these spans were never being finished. This issue was uncovered when customers upgraded their `google-api-core` dependencies to `2.17.0`; with this upgrade, the package changed many grpc calls to use async streaming. In addition to fixing the segfault, this PR also fixes the Pin object to be correctly placed on the grpcio module. Fixes #9139 ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) (cherry picked from commit 5897cab)
17 tasks
wconti27
added a commit
that referenced
this issue
May 15, 2024
This PR fixes a few issues with the `grpc aio` integration. Most notably, the integration was causing segfaults when wrapping async stream responses, most likely since these spans were never being finished. This issue was uncovered when customers upgraded their `google-api-core` dependencies to `2.17.0`; with this upgrade, the package changed many grpc calls to use async streaming. In addition to fixing the segfault, this PR also fixes the Pin object to be correctly placed on the grpcio module. Fixes #9139 - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) (cherry picked from commit 5897cab)
17 tasks
wconti27
added a commit
that referenced
this issue
May 15, 2024
….8] (#9274) Backport 5897cab from #9233 to 2.8. This PR fixes a few issues with the `grpc aio` integration. Most notably, the integration was causing segfaults when wrapping async stream responses, most likely since these spans were never being finished. This issue was uncovered when customers upgraded their `google-api-core` dependencies to `2.17.0`; with this upgrade, the package changed many grpc calls to use async streaming. In addition to fixing the segfault, this PR also fixes the Pin object to be correctly placed on the grpcio module. Fixes #9139 ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: William Conti <58711692+wconti27@users.noreply.github.com> Co-authored-by: William Conti <william.conti@datadoghq.com>
wconti27
added a commit
that referenced
this issue
May 15, 2024
….9] (#9275) Backport 5897cab from #9233 to 2.9. This PR fixes a few issues with the `grpc aio` integration. Most notably, the integration was causing segfaults when wrapping async stream responses, most likely since these spans were never being finished. This issue was uncovered when customers upgraded their `google-api-core` dependencies to `2.17.0`; with this upgrade, the package changed many grpc calls to use async streaming. In addition to fixing the segfault, this PR also fixes the Pin object to be correctly placed on the grpcio module. Fixes #9139 ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: William Conti <58711692+wconti27@users.noreply.github.com> Co-authored-by: William Conti <william.conti@datadoghq.com>
emmettbutler
added a commit
that referenced
this issue
May 17, 2024
….20] (#9276) Backport 5897cab from #9233 to 1.20. This PR fixes a few issues with the grpc aio integration. Most notably, the integration was causing segfaults when wrapping async stream responses, most likely since these spans were never being finished. This issue was uncovered when customers upgraded their google-api-core dependencies to 2.17.0; with this upgrade, the package changed many grpc calls to use async streaming. In addition to fixing the segfault, this PR also fixes the Pin object to be correctly placed on the grpcio module. Fixes #9139 ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: Emmett Butler <723615+emmettbutler@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary of problem
Enabling the grpc integration results in a
StopAsyncIteration
exception when handling streaming responses over a grpc.aio channel.Which version of dd-trace-py are you using?
2.8.3
Which version of pip are you using?
24.0
Which libraries and their versions are you using?
`pip freeze`
How can we reproduce your problem?
git clone https://gist.github.com/majorgreys/f342630b8815ccb08b8445e1864c0012 && cd f342630b8815ccb08b8445e1864c0012
pip install grpcio==1.63.0 "protobuf>=3.5.0.post1,<4.0dev" ddtrace==2.8.3
python async_greeter_server.py
ddtrace-run python async_greeter_client.py
What is the result that you get?
What is the result that you expected?
The text was updated successfully, but these errors were encountered: