Skip to content

fix(ddtrace/tracer): replace RLock with Lock for NoDebugStack check to prevent race condition#3446

Merged
darccio merged 1 commit into
mainfrom
dario.castane/single-lock-on-nodebugstack-finish
Apr 16, 2025
Merged

fix(ddtrace/tracer): replace RLock with Lock for NoDebugStack check to prevent race condition#3446
darccio merged 1 commit into
mainfrom
dario.castane/single-lock-on-nodebugstack-finish

Conversation

@darccio

@darccio darccio commented Apr 16, 2025

Copy link
Copy Markdown
Member

What does this PR do?

Reduces to a single locking operation everything in Finish's NoDebugStack.

Motivation

Per @felixge's comment, there is a potential race condition in the NoDebugStack when finishing a span.

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.

Unsure? Have a question? Request a review!

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Apr 16, 2025

Copy link
Copy Markdown

Datadog Report

Branch report: dario.castane/single-lock-on-nodebugstack-finish
Commit report: 295b632
Test service: dd-trace-go

✅ 0 Failed, 4481 Passed, 64 Skipped, 3m 46.43s Total Time

@pr-commenter

pr-commenter Bot commented Apr 16, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-04-16 13:36:12

Comparing candidate commit 8d7ee8a in PR branch dario.castane/single-lock-on-nodebugstack-finish with baseline commit f3d284b in branch main.

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

@darccio
darccio merged commit 05ae714 into main Apr 16, 2025
@darccio
darccio deleted the dario.castane/single-lock-on-nodebugstack-finish branch April 16, 2025 16:11
darccio added a commit that referenced this pull request Apr 16, 2025
@darccio darccio added the v2.0 label Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants