Skip to content

ddtrace/tracer: cap execution tracer task name length#3658

Merged
darccio merged 3 commits into
mainfrom
push-lturzqmqsuww
Jun 19, 2025
Merged

ddtrace/tracer: cap execution tracer task name length#3658
darccio merged 3 commits into
mainfrom
push-lturzqmqsuww

Conversation

@nsrip-dd

Copy link
Copy Markdown
Contributor

What does this PR do?

We use the span resource as the name for execution tracer task
annotations. The resource can be an arbitrarily large string, like an
SQL query, and the execution tracer can fail to allocate space for it in
its string table and crash. The task name isn't really used for anything
right now other than debugging. Cap the task name at some arbitrary
length to mitigate this.

Motivation

Prevent crashes

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running golangci-lint run locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

We use the span resource as the name for execution tracer task
annotations. The resource can be an arbitrarily large string, like an
SQL query, and the execution tracer can fail to allocate space for it in
its string table and crash. The task name isn't really used for anything
right now other than debugging. Cap the task name at some arbitrary
length to mitigate this.
@pr-commenter

pr-commenter Bot commented Jun 18, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-06-19 08:11:38

Comparing candidate commit 42eae0f in PR branch push-lturzqmqsuww with baseline commit 78632f2 in branch main.

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

@nsrip-dd
nsrip-dd marked this pull request as ready for review June 18, 2025 18:28
@nsrip-dd
nsrip-dd requested a review from a team as a code owner June 18, 2025 18:28
@darccio
darccio enabled auto-merge (squash) June 19, 2025 08:21
@darccio
darccio merged commit d69840b into main Jun 19, 2025
220 checks passed
@darccio
darccio deleted the push-lturzqmqsuww branch June 19, 2025 08:22
genesor pushed a commit that referenced this pull request Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants