Skip to content

Conversation

@szegedi
Copy link

@szegedi szegedi commented Jan 15, 2026

What does this PR do?:
Adds a check for whether the profile returned from v8::HeapProfiler::GetAllocationProfile() is null and throws an exception when it is.

Motivation:
We observed a crash in the wild at this location. It's possible we have a race condition between the cleanup hook and this method. Since the method is normally invoked once every ~60 seconds, the condition occurs very rarely. It's still better to throw an exception in JS (same as here before invoking the now modified method) than crash the process. dd-trace-js catches these exceptions and handles them gracefully.

Jira: PROF-13456

@szegedi szegedi added the semver-patch Bug or security fixes, mainly label Jan 15, 2026
@github-actions
Copy link

Overall package size

Self size: 1.77 MB
Deduped: 2.15 MB
No deduping: 2.15 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | source-map | 0.7.6 | 185.63 kB | 185.63 kB | | pprof-format | 2.2.1 | 163.06 kB | 163.06 kB | | p-limit | 3.1.0 | 7.75 kB | 13.78 kB | | delay | 5.0.0 | 11.17 kB | 11.17 kB | | node-gyp-build | 3.9.0 | 8.81 kB | 8.81 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@pr-commenter
Copy link

pr-commenter bot commented Jan 15, 2026

Benchmarks

Benchmark execution time: 2026-01-15 08:13:29

Comparing candidate commit 1c357cd in PR branch szegedi/null-heap-profile with baseline commit 346a336 in branch main.

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

Copy link

@r1viollet r1viollet left a comment

Choose a reason for hiding this comment

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

LGTM
NIT: I think there could be a comment around why we suspect this is happening.
Example: Concurrent cleanup...

@szegedi szegedi merged commit 2c0db1c into main Jan 15, 2026
68 checks passed
@szegedi szegedi deleted the szegedi/null-heap-profile branch January 15, 2026 09:57
szegedi added a commit that referenced this pull request Jan 15, 2026
@szegedi szegedi mentioned this pull request Jan 15, 2026
szegedi added a commit that referenced this pull request Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patch Bug or security fixes, mainly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants