-
Notifications
You must be signed in to change notification settings - Fork 431
feat(profiler): add Python 3.11 support #4343
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
Closed
Closed
+23
−9
Conversation
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
This was referenced Oct 20, 2022
Closed
787df4c
to
cbc9309
Compare
@Yun-Kim this pull request is now in conflict 😩 |
Kyle-Verhoog
added a commit
that referenced
this pull request
Oct 26, 2022
Python 3.11 has made some new changes to their C internal API that we need to address in a couple of places, mostly in our profiler. I've moved the profiler changes into #4343 and changed this PR to focus on the tracer and integrations supporting Python 3.11. Note that some of the profiler changes were kept in this PR to ensure that the profiler can compile with Python 3.11 per our setup/install rules. The major tracer-related fix is: Python 3.11 moved _PyFloat_Pack8() into their internal C API and replaced it with PyFloat_Pack8() to their public C API (Link to CPython issue). We use it once in ddtrace.internal.pack_template.h where I've added a Python version check to use the correct corresponding function. Note: grpcio with pytest-asyncio is causing Python segmentation faults on the test_unary_exception and test_unary_cancellation test cases, and from the traceback it doesn't look like dd-trace-py is involved. You can reproduce this using this gist which does not involve dd-trace-py. As a result I am skipping the grpcio_asyncio tests with Python 3.11. Co-authored-by: Kyle Verhoog <kyle@verhoog.ca>
mergify bot
pushed a commit
that referenced
this pull request
Oct 26, 2022
Python 3.11 has made some new changes to their C internal API that we need to address in a couple of places, mostly in our profiler. I've moved the profiler changes into #4343 and changed this PR to focus on the tracer and integrations supporting Python 3.11. Note that some of the profiler changes were kept in this PR to ensure that the profiler can compile with Python 3.11 per our setup/install rules. The major tracer-related fix is: Python 3.11 moved _PyFloat_Pack8() into their internal C API and replaced it with PyFloat_Pack8() to their public C API (Link to CPython issue). We use it once in ddtrace.internal.pack_template.h where I've added a Python version check to use the correct corresponding function. Note: grpcio with pytest-asyncio is causing Python segmentation faults on the test_unary_exception and test_unary_cancellation test cases, and from the traceback it doesn't look like dd-trace-py is involved. You can reproduce this using this gist which does not involve dd-trace-py. As a result I am skipping the grpcio_asyncio tests with Python 3.11. Co-authored-by: Kyle Verhoog <kyle@verhoog.ca> (cherry picked from commit c94cc14) # Conflicts: # tox.ini
@Yun-Kim this pull request is now in conflict 😩 |
I pushed a PR here: #4511 |
Closing as replaced by #4511. |
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.
Description
Python 3.11 has made some new changes to their C internal API that we need to address in a couple of places, mostly in our profiler. The profiler changes have been separated from the tracer PR #4125 and pulled into here.
I've created some initial work adding Python 3.11 to Riot and C API fixes. The fixes include:
PyFrameObject
lazily and cannot be directly accesed through aPyThreadState
object, and instead recommends using a helper functionPyThreadState_GetFrame()
which was earlier introduced in Python 3.9 (Link to issue).exc.exc_type
andexc.exc_traceback
) and now recommends using thePy_TYPE()
andPyException_GetTraceback()
helpers to access those values from the only remaining fieldexc.exc_value
. (Link to CPython change, Link to Cython fix)Note:
test_env_profiling_enabled
intests.commands.test_runner.py
as the profiler is currently breaking with Python 3.11. We'll need to remove that skip marker once feat(tracer): add Python 3.11 support #4125 is merged.Checklist
feat
andfix
pull requests.Motivation
Design
Testing strategy
Relevant issue(s)
Testing strategy
Reviewer Checklist
changelog/no-changelog
label added.