Skip to content

fix(profiling): maintain fast-copy and foreign-takeover fallback across forks (PROF-14568) - #18947

Draft
vlad-scherbich wants to merge 1 commit into
mainfrom
vlad/prof-14568-fast-copy-robustness
Draft

fix(profiling): maintain fast-copy and foreign-takeover fallback across forks (PROF-14568)#18947
vlad-scherbich wants to merge 1 commit into
mainfrom
vlad/prof-14568-fast-copy-robustness

Conversation

@vlad-scherbich

@vlad-scherbich vlad-scherbich commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

< Prev PR

Summary

Follow-up to #18798 :

  • Addresses fork edge-cases concern from review 4660571221
  • Makes a few robustness gaps raised by Codex in the parent PR

New behaviors:

  • Forked children now re-warm correctly instead of permanently staying on syscall copy when forked during warmup.
  • Children of a fallen-back parent inherit the sticky takeover flag and stay on syscall copy (safer; no handler reclaim).
  • prefork() adds a brief sampling pause around fork() in processes that use the stack profiler's pthread_atfork hook — same pattern as faulthandler handler swaps. If pause() times out (3s), fork proceeds without the pause guarantee (unchanged best-effort edge case).

Changes

  • Persistent intent flag. Add fast_copy_desired, distinct from the transient fast_copy_active. Set via set_fast_copy() / at constructor time; not touched by warmup or fallback; survives fork().
  • Warmup handler swaps (Codex Matt/pkg #1). uninstall/reinstall_segv_handler gate on fast_copy_desired, so a faulthandler swap during warmup is reclaimed instead of leaving a foreign handler in place.
  • Fork during warmup. A child forked mid-warmup re-runs the warmup decision and upgrades to safe_memcpy instead of inheriting fast_copy_active == false for life.
  • Fork after foreign-takeover fallback. fast_copy_foreign_takeover survives fork(), so a child of a parent that already fell back stays on the syscall copy and cannot reclaim our handler or re-enable fast copy.
  • Pause before fork. prefork() pauses the sampling thread (same mechanism as faulthandler) so fork() does not span an in-flight safe_memcpy; postfork_parent() resumes it. Child path resets via postfork_child / restart_after_fork.
  • Lazy mid-cycle takeover (Codex Instrument Elasticsearch #3). Re-verify handler ownership immediately before each thread.sample() while fast copy is active, narrowing the crash window for a lazily-installed foreign handler (CUDA/vLLM-style) from a whole sampling cycle to a single thread. Sticky fast_copy_foreign_takeover blocks reclaim after fallback.

Testing

[x] Tests passed locally (py3.12):

  • tests/profiling/test_main.py::test_stack_profiler_foreign_segv_handler_detection
  • tests/profiling/test_faulthandler.py
  • tests/profiling/collector/test_copy_memory_stats.py
  • tests/profiling/test_main.py

@vlad-scherbich
vlad-scherbich requested review from a team as code owners July 8, 2026 17:02
@vlad-scherbich
vlad-scherbich requested review from gyuheon0h and wconti27 and removed request for a team July 8, 2026 17:02
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codeowners resolved as

ddtrace/internal/datadog/profiling/dd_wrapper/include/profiler_state.hpp  @DataDog/profiling-python
ddtrace/internal/datadog/profiling/dd_wrapper/include/profiler_stats.hpp  @DataDog/profiling-python
ddtrace/internal/datadog/profiling/dd_wrapper/src/profiler_stats.cpp    @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack/__init__.pyi                   @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack/_stack.pyi                     @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack/echion/echion/interp.h         @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack/echion/echion/threads.h        @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack/echion/echion/vm.h             @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack/include/sampler.hpp            @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack/src/echion/interp.cc           @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack/src/echion/threads.cc          @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack/src/echion/vm.cc               @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack/src/sampler.cpp                @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack/src/stack.cpp                  @DataDog/profiling-python
releasenotes/notes/profiling-stack-sampler-foreign-handler-warmup-fork-2c9d4e7a1f6b0853.yaml  @DataDog/apm-python
tests/profiling/collector/test_copy_memory_stats.py                     @DataDog/profiling-python
tests/profiling/collector/test_utils.py                                 @DataDog/profiling-python

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 8, 2026

Copy link
Copy Markdown

Circular import analysis

⚠️ Existing circular imports

There are 33 circular imports that already exist on the base branch and have not been changed by this PR.

Show existing cycles (showing 5 of 33 shortest)
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.kafka -> ddtrace.internal.datastreams
ddtrace.internal.core -> ddtrace._trace.span -> ddtrace.internal.core
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.aiokafka -> ddtrace.internal.datastreams
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.kombu -> ddtrace.internal.datastreams
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.botocore -> ddtrace.internal.datastreams

To see all cycles, download the cycles-base.json and cycles-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/cycles.py compare cycles-base.json cycles-pr.json

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

🚦 10 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-py | build linux serverless: [amd64, cp315-cp315, v113741238-d2b8243-manylinux2014_x86_64, 1]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-py | build linux serverless: [amd64, cp315-cp315, v113741491-d2b8243-musllinux_1_2_x86_64, 1]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-py | build linux serverless: [arm64, cp315-cp315, v113741357-d2b8243-manylinux2014_aarch64, 1]   View in Datadog   GitLab

View all 10 failed jobs.

❄️ 2 New flaky tests detected

    test_fast_copy_falls_back_and_does_not_reclaim_after_takeover[py3.10] from test_copy_memory_stats.py   View in Datadog

    test_fast_copy_falls_back_and_does_not_reclaim_after_takeover[py3.12] from test_copy_memory_stats.py   View in Datadog

View in Flaky Test Management

ℹ️ Info

No other issues found (see more)

🧪 All tests passed

🔄 Datadog auto-retried 2 jobs - 2 passed on retry View in Datadog

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 46812e9 | Docs | Datadog PR Page | Give us feedback!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f149185bb9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ddtrace/internal/datadog/profiling/stack/src/sampler.cpp Outdated
Comment thread ddtrace/internal/datadog/profiling/stack/src/stack.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves robustness of the native stack profiler’s “fast copy” (safe_memcpy) mode by separating persistent configuration intent from transient runtime state, and by tightening SIGSEGV/SIGBUS handler ownership checks across warmup, fork, and mid-cycle handler takeovers.

Changes:

  • Introduces a persistent fast_copy_desired flag distinct from fast_copy_active, and updates configuration/initialization to maintain intent across warmup/fallbacks/fork.
  • Updates SIGSEGV/SIGBUS handler uninstall/reinstall and warmup/upgrade logic to key off fast_copy_desired instead of the transient active state.
  • Adds per-thread ownership re-checks right before sampling to narrow the crash window from mid-cycle foreign handler takeovers.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
releasenotes/notes/profiling-stack-sampler-foreign-handler-warmup-fork-2c9d4e7a1f6b0853.yaml Release note describing improved handler-ownership robustness across warmup, fork, and mid-cycle swaps.
ddtrace/internal/datadog/profiling/stack/src/stack.cpp Records persistent fast-copy intent; gates handler uninstall/reinstall on intent rather than transient active state.
ddtrace/internal/datadog/profiling/stack/src/sampler.cpp Uses persistent intent for warmup and handler install; adds per-thread “ensure safe” checks to detect mid-cycle takeovers.
ddtrace/internal/datadog/profiling/stack/src/echion/vm.cc Sets fast_copy_desired alongside fast_copy_active when safe memcpy initializes successfully.
ddtrace/internal/datadog/profiling/stack/echion/echion/vm.h Declares fast_copy_desired as the persistent configuration state.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ddtrace/internal/datadog/profiling/stack/src/sampler.cpp Outdated
Comment thread ddtrace/internal/datadog/profiling/stack/src/stack.cpp Outdated
@vlad-scherbich
vlad-scherbich force-pushed the vlad/prof-14568-fast-copy-robustness branch from 4b02113 to e677103 Compare July 8, 2026 18:57
@vlad-scherbich vlad-scherbich changed the title fix(profiling): harden stack sampler fault-handler ownership across warmup, fork, and mid-cycle takeovers (PROF-14568) fix(profiling): harden sampler fault-handler ownership across warmup, fork, and mid-cycle takeovers (PROF-14568) Jul 8, 2026
@vlad-scherbich vlad-scherbich changed the title fix(profiling): harden sampler fault-handler ownership across warmup, fork, and mid-cycle takeovers (PROF-14568) fix(profiling): harden sampler fault-handler on warmup, fork, and mid-cycle takeovers (PROF-14568) Jul 8, 2026
@vlad-scherbich vlad-scherbich added the Profiling Continous Profling label Jul 8, 2026
@vlad-scherbich vlad-scherbich changed the title fix(profiling): harden sampler fault-handler on warmup, fork, and mid-cycle takeovers (PROF-14568) chore(profiling): harden sampler fault-handler on warmup, fork, mid-cycle takeovers (PROF-14568) Jul 8, 2026
@vlad-scherbich vlad-scherbich added changelog/no-changelog A changelog entry is not required for this PR. and removed changelog/no-changelog A changelog entry is not required for this PR. labels Jul 8, 2026
@vlad-scherbich
vlad-scherbich force-pushed the vlad/prof-14568-fast-copy-robustness branch 2 times, most recently from 1d4a449 to a986735 Compare July 9, 2026 14:27
@vlad-scherbich
vlad-scherbich marked this pull request as draft July 9, 2026 14:39
@vlad-scherbich vlad-scherbich changed the title chore(profiling): harden sampler fault-handler on warmup, fork, mid-cycle takeovers (PROF-14568) fix(profiling): re-warm fast-copy across fork and keep foreign-takeover fallback sticky (PROF-14568) Jul 9, 2026
@vlad-scherbich vlad-scherbich changed the title fix(profiling): re-warm fast-copy across fork and keep foreign-takeover fallback sticky (PROF-14568) fix(profiling): re-warm fast-copy across fork and maintain foreign-takeover fallbacka (PROF-14568) Jul 9, 2026
@vlad-scherbich vlad-scherbich changed the title fix(profiling): re-warm fast-copy across fork and maintain foreign-takeover fallbacka (PROF-14568) fix(profiling): re-warm fast-copy across fork and keep foreign-takeover fallback sticky (PROF-14568) Jul 9, 2026
@vlad-scherbich vlad-scherbich changed the title fix(profiling): re-warm fast-copy across fork and keep foreign-takeover fallback sticky (PROF-14568) fix(profiling): maintain fast-copy and foreign-takeover fallback across forks (PROF-14568) Jul 9, 2026
@vlad-scherbich
vlad-scherbich requested a review from Copilot July 9, 2026 20:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Comment thread ddtrace/internal/datadog/profiling/stack/src/stack.cpp Outdated
Comment thread tests/profiling/collector/test_copy_memory_stats.py
Comment thread tests/profiling/collector/test_copy_memory_stats.py
Comment thread tests/profiling/collector/test_copy_memory_stats.py Outdated
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This change is marked for backport to 4.11 and it does not conflict with that branch.
The command used to test backporting was

git fetch origin 4.11 && git checkout origin/4.11 && git checkout -b backport-18947-to-4.11 && git cherry-pick -x --mainline 1 e7235b3940df41c9395b21023c72a918c02691f9

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This change is marked for backport to 4.10, but it conflicts with that branch.
Attempting to cherrypick this change to 4.10 yielded the following error:

Auto-merging ddtrace/internal/datadog/profiling/stack/__init__.pyi
CONFLICT (content): Merge conflict in ddtrace/internal/datadog/profiling/stack/__init__.pyi
CONFLICT (modify/delete): ddtrace/internal/datadog/profiling/stack/_stack.pyi deleted in HEAD and modified in e7235b3940 (Merge 9ba8262e5fad9072eedb155665e5cabebfe35a0d into 67c38f59d906fa6c3edbf52d01ca2758c578be48).  Version e7235b3940 (Merge 9ba8262e5fad9072eedb155665e5cabebfe35a0d into 67c38f59d906fa6c3edbf52d01ca2758c578be48) of ddtrace/internal/datadog/profiling/stack/_stack.pyi left in tree.
Auto-merging ddtrace/internal/datadog/profiling/stack/include/sampler.hpp
Auto-merging ddtrace/internal/datadog/profiling/stack/src/echion/threads.cc
Auto-merging ddtrace/internal/datadog/profiling/stack/src/sampler.cpp
CONFLICT (content): Merge conflict in ddtrace/internal/datadog/profiling/stack/src/sampler.cpp
Auto-merging ddtrace/internal/datadog/profiling/stack/src/stack.cpp
CONFLICT (content): Merge conflict in ddtrace/internal/datadog/profiling/stack/src/stack.cpp
Auto-merging tests/profiling/collector/test_copy_memory_stats.py
CONFLICT (content): Merge conflict in tests/profiling/collector/test_copy_memory_stats.py
error: could not apply e7235b3940... Merge 9ba8262e5fad9072eedb155665e5cabebfe35a0d into 67c38f59d906fa6c3edbf52d01ca2758c578be48

The command used to test backporting was

git fetch origin 4.10 && git checkout origin/4.10 && git checkout -b backport-18947-to-4.10 && git cherry-pick -x --mainline 1 e7235b3940df41c9395b21023c72a918c02691f9

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 12 comments.

Comments suppressed due to low confidence (1)

tests/profiling/collector/test_copy_memory_stats.py:85

  • Add an availability guard for the stack v2 native extension (_stack_ext.is_available) so this subprocess test is skipped cleanly when the extension isn't built.
@pytest.mark.skipif(sys.platform == "win32", reason="stack v2 profiler is not available on Windows")
@pytest.mark.subprocess(
    env=dict(
        DD_PROFILING_OUTPUT_PPROF="/tmp/test_fast_copy_memory_enabled",
        DD_PROFILING_UPLOAD_INTERVAL="1",
        _DD_PROFILING_STACK_FAST_COPY="1",
    ),
    err=None,
)

Comment thread tests/profiling/collector/test_copy_memory_stats.py
Comment thread tests/profiling/collector/test_copy_memory_stats.py
Comment thread tests/profiling/collector/test_copy_memory_stats.py
Comment thread tests/profiling/collector/test_copy_memory_stats.py
Comment thread tests/profiling/collector/test_copy_memory_stats.py
Comment thread tests/profiling/collector/test_copy_memory_stats.py Outdated
Comment thread tests/profiling/collector/test_copy_memory_stats.py Outdated
Comment thread ddtrace/internal/datadog/profiling/stack/src/sampler.cpp Outdated
Comment thread ddtrace/internal/datadog/profiling/stack/echion/echion/vm.h Outdated
Comment thread ddtrace/internal/datadog/profiling/stack/src/sampler.cpp

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Comment thread ddtrace/internal/datadog/profiling/stack/echion/echion/vm.h Outdated
Comment thread ddtrace/internal/datadog/profiling/stack/src/sampler.cpp Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that PR ready for review?

I find it concerning that this follow-up is almost as large (in changes count) as the original PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that PR ready for review?

Yes, you can begin if you have the time. I was waiting to open it while going over the code one more time.

@vlad-scherbich vlad-scherbich Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it concerning that this follow-up is almost as large (in changes count) as the original PR

It is not small, but tests and release note take up almost 300 LoC (290ish to be precise). So the actual code changes are "only" ~330 LoC. The reason it's so large is we try to handle lots of different edge cases with forking that you raised in the parent PR. We also make the fault-handler ownership logic more robust, per the 3 Codex recommendations from the parent PR.

The good news is that this PR is not required to fix the customer crashes. It's complimentary future-proofing the code.

@vlad-scherbich
vlad-scherbich marked this pull request as ready for review July 10, 2026 18:49
@vlad-scherbich
vlad-scherbich marked this pull request as draft July 10, 2026 18:49
@vlad-scherbich
vlad-scherbich force-pushed the vlad/prof-14568-fast-copy-robustness branch from e4ec908 to fcdda10 Compare July 13, 2026 21:31
@vlad-scherbich
vlad-scherbich requested a review from Copilot July 13, 2026 22:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Comment thread ddtrace/internal/datadog/profiling/stack/src/sampler.cpp Outdated
@vlad-scherbich
vlad-scherbich force-pushed the vlad/prof-14568-handler-ownership branch from 1ac266b to 6aea597 Compare July 14, 2026 15:34
@vlad-scherbich
vlad-scherbich force-pushed the vlad/prof-14568-fast-copy-robustness branch from cb75c54 to 34501b0 Compare July 14, 2026 18:22
@vlad-scherbich
vlad-scherbich force-pushed the vlad/prof-14568-handler-ownership branch from e1cee95 to 68d3838 Compare July 14, 2026 22:05
@vlad-scherbich
vlad-scherbich force-pushed the vlad/prof-14568-fast-copy-robustness branch from 34501b0 to 0253d11 Compare July 14, 2026 22:12
@vlad-scherbich
vlad-scherbich force-pushed the vlad/prof-14568-handler-ownership branch from 68d3838 to fd5fd49 Compare July 23, 2026 19:32
vlad-scherbich added a commit that referenced this pull request Jul 23, 2026
Replay #18947 robustness changes on top of the merged handler-ownership
branch (98c1492), preserving origin-task linking and sampler_active_
while adding atomic fast-copy flags, ownership probes, prefork pause,
and desired/foreign-takeover metadata.
@vlad-scherbich
vlad-scherbich force-pushed the vlad/prof-14568-fast-copy-robustness branch from 0253d11 to d506b08 Compare July 23, 2026 20:10
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Jul 23, 2026
…EGV handlers (PROF-15342) (#18798)

| [Next PR](#18947)

User-reported crash: https://datadoghq.atlassian.net/browse/AIPTS-1715

## Description

`safe_memcpy`'s fault recovery only works while the profiler owns the `SIGSEGV`/`SIGBUS`
handlers. Libraries like PyTorch/CUDA (and abseil via vLLM/gRPC) install their own
handler during startup; once a foreign handler owns those signals, a fault on a stale
read is no longer recovered and the process crashes ([PROF-14568](https://datadoghq.atlassian.net/browse/PROF-14568)).

This PR makes the default-on state safe and removes the need for the `_DD_PROFILING_STACK_FAST_COPY=0`
workaround. It handles the handlers we *cannot* wrap (torch/CUDA/abseil) via detect-and-fallback.

## Changes

* Sampler **starts on the safe syscall copy** (`process_vm_readv` / `mach_vm_read_overwrite`)
  for a short warmup, so a fault during crash-prone startup can't crash the process (these
  syscalls return an error instead of faulting).
* After warmup it **upgrades to `safe_memcpy` only if we still own both `SIGSEGV` and
  `SIGBUS`** (`segv_handler_installed()`).
* It **re-checks ownership every cycle** and permanently falls back to the syscall copy if
  a handler is taken over later (e.g. lazy CUDA init). If no safe fallback exists
  (`process_vm_readv` blocked), it **stops sampling** — we degrade to dropped samples,
  never a crash.
* Warmup is a fixed 15s internal constant (not a user knob). Policy is auto-fallback, not
  reinstall-and-chain, so the foreign handler stays authoritative; `init_segv_catcher`
  stays `call_once` to avoid reintroducing handler-chaining races.

## Test plan

* New unit tests
* Manual repro (synthetic + `--torch`) on #18911):
crashes on `main`, runs OK on this branch
* Tested on another internal service in staging: `ai_gateway` ([profile link](https://ddstaging.datadoghq.com/profiling/explorer?query=service%3Aai_gateway%20env%3Astaging%20version%3Afaulthandling-1ac266be&my_code=disabled&profile_type=heap-live-size&refresh_mode=paused&viz=flame_graph&from_ts=1784830809012&to_ts=1784834409012&live=false))

* Py CPU

<img width="1004" height="1024" alt="image" src="https://github.com/user-attachments/assets/5b4311bf-ee2b-4dd0-bb1f-b23f05ca567d" />

* eBPF CPU

<img width="999" height="1024" alt="image" src="https://github.com/user-attachments/assets/ada757ba-8e35-48c0-ba97-e6972f69549b" />

* Live Heap

<img width="1009" height="1024" alt="image" src="https://github.com/user-attachments/assets/c7161fad-e922-43d6-b7c8-5cfbc0706cd0" />



### Testing in User Environment:

* User deployed a binary with this and next PR (#18797) to their service; no crashes observed in 24 hours. (cc @askardog )

[PROF-14568]: https://datadoghq.atlassian.net/browse/PROF-14568?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Co-authored-by: KowalskiThomas <thomas.kowalski@datadoghq.com>
Co-authored-by: vlad.scherbich <vlad.scherbich@datadoghq.com>
Base automatically changed from vlad/prof-14568-handler-ownership to main July 23, 2026 21:06
vlad-scherbich added a commit that referenced this pull request Jul 24, 2026
Replay #18947 robustness changes on top of the merged handler-ownership
branch (98c1492), preserving origin-task linking and sampler_active_
while adding atomic fast-copy flags, ownership probes, prefork pause,
and desired/foreign-takeover metadata.
@vlad-scherbich
vlad-scherbich force-pushed the vlad/prof-14568-fast-copy-robustness branch from 9117001 to e957ddf Compare July 24, 2026 02:19
…ss forks (PROF-14568)

Follow-up to #18798: add persistent fast-copy intent flags, fork-safe
warmup re-run, sticky foreign-takeover inheritance, prefork sampling
pause, and per-cycle handler ownership checks. Publish fast-copy metadata
via ProfilerState snapshots and extend fork/warmup coverage in tests.
@vlad-scherbich
vlad-scherbich force-pushed the vlad/prof-14568-fast-copy-robustness branch from e957ddf to 46812e9 Compare July 24, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants