Skip to content

fix: properly initiate logger #16864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 9, 2025
Merged

fix: properly initiate logger #16864

merged 2 commits into from
May 9, 2025

Conversation

rubvs
Copy link
Contributor

@rubvs rubvs commented May 8, 2025

Motivation/summary

Fix panic when benchmarking

[2025-05-08T12:21:20Z] panic: runtime error: invalid memory address or nil pointer dereference
[2025-05-08T12:21:20Z] [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xeb3d57]
[2025-05-08T12:21:20Z] 
[2025-05-08T12:21:20Z] goroutine 50 [running]:
[2025-05-08T12:21:20Z] github.com/elastic/elastic-agent-libs/logp.(*Logger).Named(0xc0001799c0?, {0x192d7d0?, 0x251f680?})
[2025-05-08T12:21:20Z] 	/var/lib/buildkite-agent/go/pkg/mod/github.com/elastic/elastic-agent-libs@v0.19.4/logp/logger.go:150 +0x17
[2025-05-08T12:21:20Z] github.com/elastic/beats/v7/libbeat/idxmgmt.DefaultSupport.MakeDefaultSupport.func1(...)
[2025-05-08T12:21:20Z] 	/var/lib/buildkite-agent/go/pkg/mod/github.com/elastic/beats/v7@v7.0.0-alpha2.0.20250505142450-af0a5dad0d45/libbeat/idxmgmt/idxmgmt.go:109
[2025-05-08T12:21:20Z] github.com/elastic/beats/v7/libbeat/idxmgmt.DefaultSupport({{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, 0x0, {0x0, 0x0}, {0x0, ...}, ...}, ...)
[2025-05-08T12:21:20Z] 	/var/lib/buildkite-agent/go/pkg/mod/github.com/elastic/beats/v7@v7.0.0-alpha2.0.20250505142450-af0a5dad0d45/libbeat/idxmgmt/idxmgmt.go:97 +0x65
[2025-05-08T12:21:20Z] github.com/elastic/apm-server/internal/publish_test.BenchmarkPublisher(0xc0001682c8)
[2025-05-08T12:21:20Z] 	/var/lib/buildkite-agent/.buildkite-agent/builds/worker-1799330-build-hel1-dc1-hetzner-elasticnet-co/elastic/apm-agent-microbenchmark/apm-server-4e83d2cbd08ddc195f485b48aa8862d774a12fa5/internal/publish/pub_test.go:143 +0x15a
[2025-05-08T12:21:20Z] testing.(*B).runN(0xc0001682c8, 0x1)
[2025-05-08T12:21:20Z] 	/var/lib/buildkite-agent/.gvm/versions/go1.24.2.linux.amd64/src/testing/benchmark.go:219 +0x190
[2025-05-08T12:21:20Z] testing.(*B).run1.func1()
[2025-05-08T12:21:20Z] 	/var/lib/buildkite-agent/.gvm/versions/go1.24.2.linux.amd64/src/testing/benchmark.go:245 +0x48
[2025-05-08T12:21:20Z] created by testing.(*B).run1 in goroutine 1
[2025-05-08T12:21:20Z] 	/var/lib/buildkite-agent/.gvm/versions/go1.24.2.linux.amd64/src/testing/benchmark.go:238 +0x90
[2025-05-08T12:21:20Z] exit status 2
[2025-05-08T12:21:20Z] FAIL	github.com/elastic/apm-server/internal/publish

Checklist

For functional changes, consider:

  • Is it observable through the addition of either logging or metrics?
  • Is its use being published in telemetry to enable product improvement?
  • Have system tests been added to avoid regression?

How to test these changes

make bench

Related issues

@rubvs rubvs requested a review from a team as a code owner May 8, 2025 17:37
Copy link
Contributor

github-actions bot commented May 8, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@rubvs rubvs requested a review from kruskall May 8, 2025 17:38
Copy link
Contributor

mergify bot commented May 8, 2025

This pull request does not have a backport label. Could you fix it @rubvs? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-7.17 is the label to automatically backport to the 7.17 branch.
  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • backport-9./d is the label to automatically backport to the 9./d branch. /d is the digit.
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@simitt simitt merged commit c4cd6f6 into main May 9, 2025
16 checks passed
@simitt simitt deleted the fix-logger-panic branch May 9, 2025 06:08
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.

3 participants