Repository navigation
refactor(profiling): clarify stack unwind safety limit - #20352
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
Conversation
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🔗 Commit SHA: c058e08 | Docs | View more details | Give us feedback! |
Codeowners resolved asResolved from the full PR diff against No remaining files require a CODEOWNERS review. |
Circular import analysis
|
Dependency direction analysis
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Adopt MAX_STACK_UNWIND_SAFETY_LIMIT from #20352 while retaining asyncio task frame budgeting and upstream task-address discovery changes.
## Description [PROF-14213](https://datadoghq.atlassian.net/browse/PROF-14213) Clarifies the existing native stack safety ceiling by renaming `MAX_TASK_FRAMES` to `MAX_STACK_UNWIND_SAFETY_LIMIT` everywhere it is used, while retaining the value 2048 and the current behavior. The ceiling applies to thread, task, and greenlet stack unwinding, truncation probing, and task-aware stitching, not just task stacks. The name and comment distinguish this internal safety ceiling from the configured per-sample frame limit. Keeps asyncio boundary detection inline in `find_upper_python_stack_size` to minimize the diff. The full-stack scan, return semantics, and existing asyncio/uvloop boundary-frame caches are unchanged. This deliberately does not introduce the bounded task frame budget from #19085. ## Testing Latest follow-up (`4fcfbd6830`): - `scripts/lint cformat --fix` and `scripts/lint cformat`: passed. - `scripts/lint checks`: passed (existing repository-wide AST-grep warnings were reported). - `git diff --check`: passed. No `MAX_STACK_DISCOVERY_DEPTH` references remain. - Targeted `scripts/run-tests` in the Python 3.13 profiling environment could not start: environment setup reported an inaccessible worktree Git path and a permission error reading the generated requirements cache. The latest follow-ups have not been runtime-tested. Previously recorded validation, before these review follow-ups: - Python 3.13 profiling environment: 408 passed, 35 skipped, 2 xfailed. - Python 3.13 uvloop profiling environment: 411 passed, 32 skipped, 2 xfailed. - Native stack standalone test build on Python 3.13: all 23 C++ tests passed, including `StackUnwind.ProbeBudgetExhaustionRemainsUnknown`. - `scripts/run-benchmarks --list <changed files>`: no matching benchmark suites. ## Risks Low. This is an internal naming and comment change. The safety-limit value, all call sites, full-stack boundary scan, boundary caching, and stitching behavior are unchanged. ## Additional Notes This is prerequisite 1 for #19085. No release note is needed because the change is internal and behavior-preserving; the PR uses the `changelog/no-changelog` label. [PROF-14213]: https://datadoghq.atlassian.net/browse/PROF-14213?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Co-authored-by: taegyun.kim <taegyun.kim@datadoghq.com>
Description
PROF-14213
Clarifies the existing native stack safety ceiling by renaming
MAX_TASK_FRAMEStoMAX_STACK_UNWIND_SAFETY_LIMITeverywhere it is used, while retaining the value 2048 and the current behavior.The ceiling applies to thread, task, and greenlet stack unwinding, truncation probing, and task-aware stitching, not just task stacks. The name and comment distinguish this internal safety ceiling from the configured per-sample frame limit.
Keeps asyncio boundary detection inline in
find_upper_python_stack_sizeto minimize the diff. The full-stack scan, return semantics, and existing asyncio/uvloop boundary-frame caches are unchanged.This deliberately does not introduce the bounded task frame budget from #19085.
Testing
Latest follow-up (
4fcfbd6830):scripts/lint cformat --fixandscripts/lint cformat: passed.scripts/lint checks: passed (existing repository-wide AST-grep warnings were reported).git diff --check: passed. NoMAX_STACK_DISCOVERY_DEPTHreferences remain.scripts/run-testsin the Python 3.13 profiling environment could not start: environment setup reported an inaccessible worktree Git path and a permission error reading the generated requirements cache. The latest follow-ups have not been runtime-tested.Previously recorded validation, before these review follow-ups:
StackUnwind.ProbeBudgetExhaustionRemainsUnknown.scripts/run-benchmarks --list <changed files>: no matching benchmark suites.Risks
Low. This is an internal naming and comment change. The safety-limit value, all call sites, full-stack boundary scan, boundary caching, and stitching behavior are unchanged.
Additional Notes
This is prerequisite 1 for #19085.
No release note is needed because the change is internal and behavior-preserving; the PR uses the
changelog/no-changeloglabel.