Skip to content

Remove github.com/DataDog/zstd_0 dependency - #512

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
carlosroman/AGTMETRICS-340-remove_zstd_0
Aug 10, 2026
Merged

Remove github.com/DataDog/zstd_0 dependency#512
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
carlosroman/AGTMETRICS-340-remove_zstd_0

Conversation

@carlosroman

Copy link
Copy Markdown
Contributor

What does this PR do?

Removes zstd_0 from this project.

Motivation

zstd_0 is an abandoned fork of an old zstd version with known memory safety vulnerabilities. MessageEncodingZstdPB now returns an unsupported-encoding error on encode/decode, matching the behavior already used by the no-cgo build.

Additional Notes

Once merged we need to bump the one found in the Datadog Agent to the latest version of this project.

Possible Drawbacks / Trade-offs

It will now error if anyone uses zstd_0.

zstd_0 is an abandoned fork of an old zstd version with known memory
safety vulnerabilities. MessageEncodingZstdPB now returns an
unsupported-encoding error on encode/decode, matching the behavior
already used by the no-cgo build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@carlosroman
carlosroman requested review from a team as code owners August 10, 2026 13:39
Comment thread process/compress.go
d, err = decoder.DecodeAll(body, nil)
} else {
d, err = zstd_0.Decompress(nil, body)
return fmt.Errorf("unsupported encoding: MessageEncodingZstdPB is no longer supported")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very nice

@datadog-prod-us1-6 datadog-prod-us1-6 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.

Datadog Autotest: FAIL

The current Datadog Agent still selects MessageEncodingZstdPB for normal process payloads and drops messages when encoding fails. Adopting this library release without first migrating that caller would stop process and container submissions.

📊 Validated against 8 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 1fcb846 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Comment thread process/compress.go
if err != nil {
return nil, err
}
return nil, fmt.Errorf("unsupported encoding: MessageEncodingZstdPB is no longer supported")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Migrate the Agent before rejecting its default encoding

Bumping the Datadog Agent to this release as planned would silently drop normal process and container payloads before submission, leaving process visibility incomplete.

Assertion details
  • Input: A cgo Agent process or container payload passed through its current api.EncodePayload path, which selects MessageEncodingZstdPB for every message type except connections and process events.
  • Expected: Update the Agent payload encoder and fake-intake fixtures to a supported encoding, validate that encoding against intake, and only then adopt this library release. This coordinated cross-repository migration cannot be expressed as a safe line-bounded suggestion here without restoring the vulnerable dependency.
  • Actual: EncodeMessage returns unsupported encoding: MessageEncodingZstdPB is no longer supported with a nil payload. The current Agent submitter logs this encoding error and skips the message.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

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.

No because the plan is to remove zstd_0 from the Agent.

@carlosroman

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 10, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-10 14:29:35 UTC ℹ️ Start processing command /merge


2026-08-10 14:29:41 UTC ℹ️ MergeQueue: Pull request is not mergeable yet

It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.

  • Run /code blockers to see what is blocking it.
  • Run /remove to cancel it.

2026-08-10 14:31:20 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in master is approximately 2m (p90).


2026-08-10 14:34:41 UTC ℹ️ MergeQueue: This merge request was merged

@gengnamstyle gengnamstyle 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.

Overall lgtm, however, for the eventual agent side bump can you couple that with a change for our default encoding from MessageEncodingZstdPB to MessageEncodingZstd1xPB and updating the fake-intake fixtures?

otherwise just a bump would lead to the unsupported encoding case for our payloads

@carlosroman

Copy link
Copy Markdown
Contributor Author

Overall lgtm, however, for the eventual agent side bump can you couple that with a change for our default encoding from MessageEncodingZstdPB to MessageEncodingZstd1xPB and updating the fake-intake fixtures?

otherwise just a bump would lead to the unsupported encoding case for our payloads

Oh yeah, the plan is to remove the other calls to zstd_0 in the Agent.

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 3bf198a into master Aug 10, 2026
9 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the carlosroman/AGTMETRICS-340-remove_zstd_0 branch August 10, 2026 14:34
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