Skip to content

fix(profiler): handle non-frame objects while stack-unwinding #5019

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

Merged

Conversation

P403n1x87
Copy link
Contributor

@P403n1x87 P403n1x87 commented Feb 1, 2023

Following reports of Python 3.11 returning non-frame objects while unwinding the stack of a running thread, this change adds handling code that prevents exceptions from being raised.

Checklist

  • Change(s) are motivated and described in the PR description.
  • Testing strategy is described if automated tests are not included in the PR.
  • Risk is outlined (performance impact, potential for breakage, maintainability, etc).
  • Change is maintainable (easy to change, telemetry, documentation).
  • Library release note guidelines are followed.
  • Documentation is included (in-code, generated user docs, public corp docs).

Reviewer Checklist

  • Title is accurate.
  • No unnecessary changes are introduced.
  • Description motivates each change.
  • Avoids breaking API changes unless absolutely necessary.
  • Testing strategy adequately addresses listed risk(s).
  • Change is maintainable (easy to change, telemetry, documentation).
  • Release note makes sense to a user of the library.

@P403n1x87 P403n1x87 added the Profiling Continous Profling label Feb 1, 2023
@P403n1x87 P403n1x87 requested review from a team as code owners February 1, 2023 14:41
@P403n1x87 P403n1x87 force-pushed the fix/profiler-py311-alien-frame-objects branch from 450cb19 to 735b639 Compare February 1, 2023 14:54
Following reports of Python 3.11 returning non-frame objects while
unwinding the stack of a running thread, this change adds handling
code that prevents exceptions from being raised.
@P403n1x87 P403n1x87 changed the title fix(profiler): handle non-frame objects while stack unwinding fix(profiler): handle non-frame objects while stack-unwinding Feb 1, 2023
@P403n1x87 P403n1x87 force-pushed the fix/profiler-py311-alien-frame-objects branch from 735b639 to 8e73fd6 Compare February 1, 2023 16:48
@P403n1x87 P403n1x87 force-pushed the fix/profiler-py311-alien-frame-objects branch from 4cd5af9 to d4a7773 Compare February 1, 2023 17:28
@codecov-commenter
Copy link

codecov-commenter commented Feb 1, 2023

Codecov Report

Merging #5019 (d4a7773) into 1.x (4aa5af3) will increase coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              1.x    #5019      +/-   ##
==========================================
+ Coverage   74.92%   74.95%   +0.02%     
==========================================
  Files         824      824              
  Lines       63823    63823              
==========================================
+ Hits        47820    47837      +17     
+ Misses      16003    15986      -17     
Impacted Files Coverage Δ
ddtrace/internal/telemetry/writer.py 33.79% <0.00%> (-0.69%) ⬇️
tests/utils.py 90.42% <0.00%> (+0.23%) ⬆️
tests/contrib/aiohttp/app/web.py 100.00% <0.00%> (+1.03%) ⬆️
...ests/contrib/aiohttp_jinja2/test_aiohttp_jinja2.py 100.00% <0.00%> (+14.81%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

brettlangdon
brettlangdon previously approved these changes Feb 1, 2023
@P403n1x87 P403n1x87 enabled auto-merge (squash) February 2, 2023 11:20
@P403n1x87 P403n1x87 merged commit ea7c9c6 into DataDog:1.x Feb 2, 2023
@Yun-Kim Yun-Kim mentioned this pull request Feb 6, 2023
brettlangdon pushed a commit that referenced this pull request Feb 10, 2023
Following reports of Python 3.11 returning non-frame objects while
unwinding the stack of a running thread, this change adds handling code
that prevents exceptions from being raised.

(cherry picked from commit ea7c9c6)
majorgreys pushed a commit that referenced this pull request Feb 10, 2023
…rt 1.8] (#5091)

Backport ea7c9c6 from #5019 to 1.8.

Following reports of Python 3.11 returning non-frame objects while
unwinding the stack of a running thread, this change adds handling code
that prevents exceptions from being raised.

## 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] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines)
are followed.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).


## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.

Co-authored-by: Gabriele N. Tornetta <[email protected]>
brettlangdon pushed a commit that referenced this pull request Feb 10, 2023
Following reports of Python 3.11 returning non-frame objects while
unwinding the stack of a running thread, this change adds handling code
that prevents exceptions from being raised.

(cherry picked from commit ea7c9c6)
brettlangdon pushed a commit that referenced this pull request Feb 10, 2023
Following reports of Python 3.11 returning non-frame objects while
unwinding the stack of a running thread, this change adds handling code
that prevents exceptions from being raised.

(cherry picked from commit ea7c9c6)
brettlangdon pushed a commit that referenced this pull request Feb 10, 2023
Following reports of Python 3.11 returning non-frame objects while
unwinding the stack of a running thread, this change adds handling code
that prevents exceptions from being raised.

(cherry picked from commit ea7c9c6)
brettlangdon pushed a commit that referenced this pull request Feb 10, 2023
…rt 1.7] (#5090)

Backport ea7c9c6 from #5019 to 1.7.

Following reports of Python 3.11 returning non-frame objects while
unwinding the stack of a running thread, this change adds handling code
that prevents exceptions from being raised.

## 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] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines)
are followed.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).


## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.

Co-authored-by: Gabriele N. Tornetta <[email protected]>
ZStriker19 pushed a commit that referenced this pull request Feb 17, 2023
….11 (#5153)

This PR removes the known issue release note for the profiler on Python
3.11 relating to `PyFrameObjects`, which was mitigated by #5019.
## 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] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines)
are followed.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Author is aware of the performance implications of this PR as
reported in the benchmarks PR comment.

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer is aware of, and discussed the performance implications
of this PR as reported in the benchmarks PR comment.
ZStriker19 pushed a commit that referenced this pull request Feb 17, 2023
….11 (#5153)

This PR removes the known issue release note for the profiler on Python
3.11 relating to `PyFrameObjects`, which was mitigated by #5019.
## 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] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines)
are followed.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Author is aware of the performance implications of this PR as
reported in the benchmarks PR comment.

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer is aware of, and discussed the performance implications
of this PR as reported in the benchmarks PR comment.

(cherry picked from commit 066688c)
brettlangdon pushed a commit that referenced this pull request Feb 17, 2023
….11 [backport #5153 to 1.8] (#5154)

Backport of #5153 to 1.8

This PR removes the known issue release note for the profiler on Python
3.11 relating to `PyFrameObjects`, which was mitigated by #5019.
## 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] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines)
are followed.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Author is aware of the performance implications of this PR as
reported in the benchmarks PR comment.

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer is aware of, and discussed the performance implications
of this PR as reported in the benchmarks PR comment.

Co-authored-by: Yun Kim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Profiling Continous Profling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants