Skip to content

fix(ipc): Fallback to ftruncate if fallocate gets EPERM#1938

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits intomainfrom
bob/fallocate-fallback
May 4, 2026
Merged

fix(ipc): Fallback to ftruncate if fallocate gets EPERM#1938
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits intomainfrom
bob/fallocate-fallback

Conversation

@bwoebi
Copy link
Copy Markdown
Contributor

@bwoebi bwoebi commented Apr 30, 2026

I have no idea how fallocate is ever returning EPERM here, but apparently it is for some users. So, ... falling back it is.

@bwoebi bwoebi requested a review from a team as a code owner April 30, 2026 15:03
@bwoebi bwoebi changed the title Fallback to ftruncate if fallocate gets EPERM fix(ipc): Fallback to ftruncate if fallocate gets EPERM Apr 30, 2026
Copy link
Copy Markdown

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

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: 00b9d8d24f

ℹ️ 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 datadog-ipc/src/platform/unix/mem_handle.rs Outdated
@bwoebi bwoebi force-pushed the bob/fallocate-fallback branch from 00b9d8d to a70521b Compare April 30, 2026 15:07
@github-actions
Copy link
Copy Markdown
Contributor

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/bob/fallocate-fallback

Summary by Rule

Rule Base Branch PR Branch Change
unwrap_used 2 2 No change (0%)
Total 2 2 No change (0%)

Annotation Counts by File

File Base Branch PR Branch Change
datadog-ipc/src/platform/unix/mem_handle.rs 2 2 No change (0%)

Annotation Stats by Crate

Crate Base Branch PR Branch Change
clippy-annotation-reporter 5 5 No change (0%)
datadog-ffe-ffi 1 1 No change (0%)
datadog-ipc 21 21 No change (0%)
datadog-live-debugger 6 6 No change (0%)
datadog-live-debugger-ffi 10 10 No change (0%)
datadog-profiling-replayer 4 4 No change (0%)
datadog-remote-config 3 3 No change (0%)
datadog-sidecar 57 57 No change (0%)
libdd-common 10 10 No change (0%)
libdd-common-ffi 12 12 No change (0%)
libdd-data-pipeline 5 5 No change (0%)
libdd-ddsketch 2 2 No change (0%)
libdd-dogstatsd-client 1 1 No change (0%)
libdd-profiling 13 13 No change (0%)
libdd-telemetry 19 19 No change (0%)
libdd-tinybytes 4 4 No change (0%)
libdd-trace-normalization 2 2 No change (0%)
libdd-trace-obfuscation 8 8 No change (0%)
libdd-trace-stats 1 1 No change (0%)
libdd-trace-utils 15 15 No change (0%)
Total 199 199 No change (0%)

About This Report

This report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality.

@bwoebi bwoebi force-pushed the bob/fallocate-fallback branch from a70521b to 65e0028 Compare April 30, 2026 17:02
@datadog-prod-us1-5
Copy link
Copy Markdown

datadog-prod-us1-5 Bot commented Apr 30, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 50.00%
Overall Coverage: 71.71% (-0.02%)

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

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 30, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.70%. Comparing base (5db2a80) to head (d2bd8fd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1938      +/-   ##
==========================================
- Coverage   71.72%   71.70%   -0.02%     
==========================================
  Files         434      434              
  Lines       70379    70384       +5     
==========================================
- Hits        50480    50471       -9     
- Misses      19899    19913      +14     
Components Coverage Δ
libdd-crashtracker 66.00% <ø> (-0.02%) ⬇️
libdd-crashtracker-ffi 34.47% <ø> (ø)
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 85.86% <ø> (ø)
libdd-data-pipeline-ffi 71.79% <ø> (ø)
libdd-common 79.37% <ø> (ø)
libdd-common-ffi 73.87% <ø> (ø)
libdd-telemetry 68.12% <ø> (ø)
libdd-telemetry-ffi 19.37% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 76.17% <50.00%> (-0.14%) ⬇️
libdd-profiling 81.61% <ø> (ø)
libdd-profiling-ffi 64.36% <ø> (ø)
datadog-sidecar 28.92% <ø> (-0.05%) ⬇️
datdog-sidecar-ffi 8.78% <ø> (ø)
spawn-worker 54.69% <ø> (ø)
libdd-tinybytes 93.16% <ø> (ø)
libdd-trace-normalization 81.71% <ø> (ø)
libdd-trace-obfuscation 87.26% <ø> (ø)
libdd-trace-protobuf 68.25% <ø> (ø)
libdd-trace-utils 89.27% <ø> (ø)
libdd-tracer-flare 86.88% <ø> (ø)
libdd-log 74.69% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Apr 30, 2026

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.63 MB 7.63 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 83.32 MB 83.32 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 99.45 MB 99.45 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.17 MB 10.17 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 25.21 MB 25.21 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 79.57 KB 79.57 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 184.48 MB 184.48 MB +0% (+8.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 918.30 MB 918.30 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 7.89 MB 7.89 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 79.57 KB 79.57 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 23.68 MB 23.68 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 46.20 MB 46.20 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 21.69 MB 21.69 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 80.81 KB 80.81 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 188.65 MB 188.65 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 904.01 MB 904.01 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.14 MB 6.14 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 80.81 KB 80.81 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 25.37 MB 25.37 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 43.69 MB 43.69 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 74.29 MB 74.29 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.55 MB 8.55 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 91.83 MB 91.83 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.21 MB 10.21 MB 0% (0 B) 👌

@bwoebi bwoebi force-pushed the bob/fallocate-fallback branch 4 times, most recently from 0e72b16 to d34a83c Compare April 30, 2026 19:40
Copy link
Copy Markdown
Contributor

@morrisonlevi morrisonlevi left a comment

Choose a reason for hiding this comment

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

BTW, we think this happens because of seccomp. Patch looks good, have some very minor suggestions.

Comment thread datadog-ipc/src/platform/mem_handle.rs Outdated
Comment on lines 96 to 97
// Use fallocate on Linux to eagerly commit the new pages: ENOSPC at resize time is
// recoverable; a later SIGBUS mid-execution is not.
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.

"Try to use" now.

Comment thread datadog-ipc/src/platform/mem_handle.rs Outdated
new_size,
)?;
) {
Err(nix::Error::EPERM | nix::Error::ENOSYS) => nix::unistd::ftruncate(fd, new_size)?,
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.

Maybe EOPNOTSUPP? If this uses a file-based fallback then it might conceivably return that?

bwoebi added 2 commits May 4, 2026 14:56
I have no idea how fallocate is ever returning EPERM here, but apparently it is for some users. So, ... falling back it is.
@bwoebi bwoebi force-pushed the bob/fallocate-fallback branch from d34a83c to d2bd8fd Compare May 4, 2026 12:57
@bwoebi
Copy link
Copy Markdown
Contributor Author

bwoebi commented May 4, 2026

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 Bot commented May 4, 2026

View all feedbacks in Devflow UI.

2026-05-04 12:57:50 UTC ℹ️ Start processing command /merge


2026-05-04 12:57:57 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals. View in MergeQueue UI.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2026-05-04 13:31:12 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in main is approximately 49m (p90).


2026-05-04 14:18:16 UTC ℹ️ MergeQueue: This merge request was merged

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