chore(profiling-315): compile natives on 3.15 and add allow_failure job - #19270
Conversation
🎉 All green!🧪 All tests passed 🔗 Commit SHA: 33d1ad8 | Docs | View more details | Give us feedback! |
9a117a3 to
188e8e1
Compare
7d3e825 to
9ef0d6d
Compare
188e8e1 to
e6e1f72
Compare
9ef0d6d to
6f9a44c
Compare
Circular import analysis
|
Codeowners resolved asResolved from the full PR diff against |
Dependency direction analysis
|
6f9a44c to
ee28a3f
Compare
e6e1f72 to
0fb56d5
Compare
BenchmarksBenchmark execution time: 2026-09-02 19:47:18 Comparing candidate commit 33d1ad8 in PR branch Found 0 performance improvements and 5 performance regressions! Performance is the same for 579 metrics, 10 unstable metrics, 1 known flaky benchmarks, 17 flaky benchmarks without significant changes.
|
b2cdb77 to
2d20a3c
Compare
ee28a3f to
b7a93de
Compare
2d20a3c to
29f2a6e
Compare
b7a93de to
c3ee47f
Compare
There was a problem hiding this comment.
Pull request overview
Updates profiling collectors and CI/build wiring to better support Python 3.15, including making collector imports resilient when profiling Cython extensions are not present and extending the riot/CI matrices and lockfiles to exercise 3.15.
Changes:
- Add ImportError fallbacks/stubs for profiling collectors that depend on Cython extensions (
_lock,_task,_exception) so profiling can be imported and collectors can be gracefully skipped when extensions aren’t available. - Update
setup.pygating and environment to allow building profiling/crashtracker natives on Python 3.15 (incl. PyO3 ABI3 forward-compat safety net). - Extend riot/lockfiles and CI configuration to include Python 3.15 coverage for relevant suites/jobs.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/profiling/test_scheduler.py | Stabilizes scheduler logging test by patching upload and adds type hints. |
| setup.py | Enables profiling-related native builds through 3.15 and sets PyO3 ABI3 forward-compat env var on 3.15+. |
| scripts/requirements_to_csv.py | Improves typing (untyped toml) and normalizes CSV line endings. |
| riotfile.py | Adds/selects 3.15 in specific venv definitions and updates a protobuf incompat comment. |
| ddtrace/profiling/collector/threading.py | Adds ImportError fallback stubs when _lock extension isn’t available. |
| ddtrace/profiling/collector/asyncio.py | Adds ImportError fallback stubs when _lock extension isn’t available. |
| ddtrace/profiling/collector/exception.py | Adds ImportError fallback stub for _exception extension. |
| ddtrace/profiling/collector/stack.py | Adds ImportError fallback stub for _task extension to keep StackCollector importable. |
| ddtrace/profiling/_asyncio.py | Adjusts task-linking wrappers to avoid failures when called outside a running loop. |
| ddtrace/internal/monitoring.py | Adds a guarded fallback when PY_UNWIND is rejected as a local monitoring event. |
| .riot/requirements/e26245b.txt | Adds a newly generated Python 3.15 lockfile. |
| .riot/requirements/95077af.txt | Adds a newly generated Python 3.15 lockfile. |
| .riot/requirements/222bcd0.txt | Adds a newly generated lockfile (currently contains merge-conflict markers). |
| .riot/requirements/1c6cb02.txt | Adds a newly generated Python 3.15 lockfile. |
| .gitlab/templates/build-base-venvs.yml | Extends artifact paths for profiling-native test outputs. |
| .gitlab-ci.yml | Adds an allow-failure profiling native job for Python 3.15 pending base-image support. |
| .github/workflows/generate-package-versions.yml | Adds Python 3.15 to the workflow’s installed Python set. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
29f2a6e to
717a251
Compare
c3ee47f to
47ff18b
Compare
4c56561 to
c19adca
Compare
a1f0603 to
81640b8
Compare
|
|
||
| def _set_local_events(tool_id: int, code: CodeType, events: int) -> None: | ||
| sys.monitoring.set_local_events(tool_id, code, events) | ||
| # TODO(py-315): Pre-release Python 3.15 builds may reject PY_UNWIND |
There was a problem hiding this comment.
Does this have a regression test?
| os.makedirs(os.path.dirname(path), exist_ok=True) | ||
| with open(path, "w", newline="") as f: | ||
| writer = csv.writer(f) | ||
| writer = csv.writer(f, lineterminator="\n") |
There was a problem hiding this comment.
Why's this necessary?
| Venv( | ||
| pys=select_pys(min_version="3.12"), | ||
| # TODO(py-315): 3.15 explicitly opted in for crashtracker native validation. | ||
| pys=select_pys(min_version="3.12", max_version="3.14") + ["3.15"], |
There was a problem hiding this comment.
| pys=select_pys(min_version="3.12", max_version="3.14") + ["3.15"], | |
| pys=select_pys(min_version="3.12", max_version="3.15"), |
| - ddtrace/**/*.so* | ||
| - .riot/venv_* | ||
| - ddtrace/internal/datadog/profiling/test/test_* | ||
| - ddtrace/internal/datadog/profiling/test/py315/test_* |
There was a problem hiding this comment.
Why do these need to be passed as artifacts? Are they generated dynamically?
c19adca to
4a90e1a
Compare
81640b8 to
da3df55
Compare
da3df55 to
989dea6
Compare
4a90e1a to
a3f34cd
Compare
989dea6 to
551605d
Compare
a3f34cd to
be2ca2c
Compare
551605d to
33d1ad8
Compare
33d1ad8
into
vlad/ddtracepy-315-profiling-native
prev: #19269 | next: #19272
Description
Delta vs #19269.
setup.pylifts the four profiling / crashtracker / memalloc /_threadingcompile gates from< (3, 15)to< (3, 16), andsetdefaultsPYO3_USE_ABI3_FORWARD_COMPATIBILITY=1on 3.15.profiling_native_py315is a separateallow_failurejob until the profiling_native image ships 3.15.Does not add collector stubs, the asyncio
current_task()swallow, thePY_UNWINDfallback, or riot 3.15 schedules.profiling_native_py315allow_failureTesting
Risks
Additional Notes
CI chore,
changelog/no-changelog. Leftovers extracted to sibling/child drafts.Contributes to #17817
Pre-review checklist