Skip to content

fix(log/slog): deadlock when calling SetDefault with the original default handle#3931

Merged
dd-mergequeue[bot] merged 3 commits into
mainfrom
eliottness/fix-slog-deadlock
Aug 29, 2025
Merged

fix(log/slog): deadlock when calling SetDefault with the original default handle#3931
dd-mergequeue[bot] merged 3 commits into
mainfrom
eliottness/fix-slog-deadlock

Conversation

@eliottness

@eliottness eliottness commented Aug 29, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes a deadlock where calling slog.SetDefault with the default handler would create a deadlock. A special path is made in SetDefault for the default handle that we need to restore since the cast is failing because of orchestrion (more info here )

Supersedes #3926

Motivation

Stop deadlocking people 👍 👍 👍

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 ./scripts/lint.sh 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!

@github-actions github-actions Bot added the apm:ecosystem contrib/* related feature requests or bugs label Aug 29, 2025
@pr-commenter

pr-commenter Bot commented Aug 29, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-08-29 13:51:36

Comparing candidate commit 9f57dc0 in PR branch eliottness/fix-slog-deadlock with baseline commit 105f1ef in branch main.

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

Signed-off-by: Eliott Bouhana <[email protected]>
@eliottness
eliottness marked this pull request as ready for review August 29, 2025 13:43
@eliottness
eliottness requested review from a team as code owners August 29, 2025 13:43

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

Fixes the issue I was seeing thanks!

@eliottness

Copy link
Copy Markdown
Contributor Author

/merge

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Aug 29, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-08-29 13:57:40 UTC ℹ️ Start processing command /merge


2025-08-29 13:57:50 UTC ℹ️ MergeQueue: pull request added to the queue

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


2025-08-29 14:09:31 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue
dd-mergequeue Bot merged commit 8aae132 into main Aug 29, 2025
224 checks passed
@dd-mergequeue
dd-mergequeue Bot deleted the eliottness/fix-slog-deadlock branch August 29, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apm:ecosystem contrib/* related feature requests or bugs mergequeue-status: done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants