Skip to content
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

fix(profiling): clear sample pool after fork [backport 2.15] #11356

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 11, 2024

Backport 9de85e3 from #11350 to 2.15.

Tested with native tests

crossbeam::ArrayQueue uses Rust std::sync::atomic which doesn't seem to be consistent across fork() calls as std::mutex from C++ isn't. So we need to make sure, an equivalent of std::mutex::unlock() happens after fork.

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

Tested with native tests

`crossbeam::ArrayQueue` uses Rust `std::sync::atomic` which doesn't seem
to be consistent across `fork()` calls as `std::mutex` from C++ isn't.
So we need to make sure, an equivalent of `std::mutex::unlock()` happens
after fork.

## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, author has acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment
- Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

(cherry picked from commit 9de85e3)
@github-actions github-actions bot requested a review from a team as a code owner November 11, 2024 21:36
@github-actions github-actions bot added the Profiling Continous Profling label Nov 11, 2024
@github-actions github-actions bot requested a review from a team as a code owner November 11, 2024 21:36
@taegyunkim taegyunkim closed this Nov 11, 2024
@taegyunkim taegyunkim reopened this Nov 11, 2024
Copy link
Contributor Author

CODEOWNERS have been resolved as:

releasenotes/notes/profiling-sample-pool-461a108e068dea5b.yaml          @DataDog/apm-python
ddtrace/internal/datadog/profiling/dd_wrapper/src/sample_manager.cpp    @DataDog/profiling-python

@pr-commenter
Copy link

pr-commenter bot commented Nov 11, 2024

Benchmarks

Benchmark execution time: 2024-11-11 22:17:33

Comparing candidate commit 9fbf850 in PR branch backport-11350-to-2.15 with baseline commit b40447e in branch 2.15.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 371 metrics, 53 unstable metrics.

@taegyunkim taegyunkim enabled auto-merge (squash) November 11, 2024 23:09
@taegyunkim taegyunkim merged commit 883fc5a into 2.15 Nov 11, 2024
628 of 631 checks passed
@taegyunkim taegyunkim deleted the backport-11350-to-2.15 branch November 11, 2024 23:15
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.

1 participant