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

[PROF-3760] Revert "Merge pull request #3760 from DataDog/ivoanjo/prof-10123-placeholder-missing-allocations" #3775

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

ivoanjo
Copy link
Member

@ivoanjo ivoanjo commented Jul 10, 2024

What does this PR do?

This PR reverts the change from #3760.

While we still want to add this feature, the implementation in #3760 can cause heap profiler to fail with an exception.

This failure also uncovered a few other potential bugs in our error handling code.

Thus, to be on the safe side, and because we want to get a new release out, I'm reverting the whole PR, until I can re-open a fixed version.

Motivation:

Remove blockers from the 2.2.0 release.

Additional Notes:

This reverts commit 7732142, reversing changes made to ca006e9.

How to test the change?

Validate that CI is still green.

…f-10123-placeholder-missing-allocations"

**What does this PR do?**

This PR reverts the change from #3760.

While we still want to add this feature, the implementation in #3760
can cause heap profiler to fail with an exception.

This failure also uncovered a few other potential bugs in our error
handling code.

Thus, to be on the safe side, and because we want to get a new release
out, I'm reverting the whole PR, until I can re-open a fixed version.

**Motivation:**

Remove blockers from the 2.2.0 release.

**Additional Notes:**

This reverts commit 7732142, reversing
changes made to ca006e9.

**How to test the change?**

Validate that CI is still green.
@ivoanjo ivoanjo requested a review from a team as a code owner July 10, 2024 12:47
@github-actions github-actions bot added the profiling Involves Datadog profiling label Jul 10, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.91%. Comparing base (a152340) to head (229d5d0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3775      +/-   ##
==========================================
- Coverage   97.92%   97.91%   -0.01%     
==========================================
  Files        1243     1243              
  Lines       74964    74904      -60     
  Branches     3613     3611       -2     
==========================================
- Hits        73406    73344      -62     
- Misses       1558     1560       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ivoanjo ivoanjo merged commit eff7b3a into master Jul 10, 2024
170 checks passed
@ivoanjo ivoanjo deleted the ivoanjo/prof-3760-temporary-revert branch July 10, 2024 14:16
@github-actions github-actions bot added this to the 2.2.0 milestone Jul 10, 2024
ivoanjo added a commit that referenced this pull request Jul 18, 2024
…eap profiler, try 2

Adding the "skipped samples" placeholder breaks the heap profiler, as
it starts failing with:

> WARN -- datadog: [datadog] CpuAndWallTimeWorker thread error. Cause:
> RuntimeError Ended a heap recording that was not started
> WARN -- datadog: [datadog] Detected issue with profiler (worker
> component), stopping profiling.

This is because the stack recorder up until now used the check for
`alloc_samples > 0` as a proxy for "this is an allocation sample, and
someone already called `track_object(...)` with it".

The addition of the skipped samples placeholder broke this assumption,
as it uses `alloc_samples > 0` but explicitly there's no object being
tracked.

To fix this issue, I've added a new argument to the `sample_values`
that explicitly marks a sample as also being heap (or not). Thus,
we can now explicitly tell the stack recorder which situation we are in
using that flag, instead of trying to derive it from `alloc_samples >
0`.

This is actually the second attempt at fixing this. The first attempt
got reverted along with
#3775 because it tried to
detect placeholders (and thus used a placeholder as a proxy for
"someone called `track_object(...)`". This was incorrect because
there's other placeholders than just the "skipped samples" (case in
point: the "In native code" placeholder), which can happen together
with an object allocation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
profiling Involves Datadog profiling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants