-
Notifications
You must be signed in to change notification settings - Fork 204
otel/manager: fix panic in countHealthCheckExtensionStatuses #11706
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
Conversation
CI tests reveal the following panic:
```
=== FAIL: internal/pkg/otel/manager TestOTelManager_Run (300.01s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1e3fa37]
goroutine 923 [running]:
testing.tRunner.func1.2({0x20ab660, 0x2ef4510})
/opt/buildkite-agent/.asdf/installs/golang/1.24.11/go/src/testing/testing.go:1734 +0x3eb
testing.tRunner.func1()
/opt/buildkite-agent/.asdf/installs/golang/1.24.11/go/src/testing/testing.go:1737 +0x696
panic({0x20ab660?, 0x2ef4510?})
/opt/buildkite-agent/.asdf/installs/golang/1.24.11/go/src/runtime/panic.go:792 +0x132
github.com/elastic/elastic-agent/internal/pkg/otel/manager.countHealthCheckExtensionStatuses(0x0)
/opt/buildkite-agent/builds/bk-agent-prod-gcp-1765273351968763419/elastic/elastic-agent/internal/pkg/otel/manager/manager_test.go:294 +0x37
github.com/elastic/elastic-agent/internal/pkg/otel/manager.TestOTelManager_Run.func4(0xc000166000, 0xc0001c2000, 0xc0002dc7e0, 0xc0002a62d0, 0xc00057be18?, 0x1?)
/opt/buildkite-agent/builds/bk-agent-prod-gcp-1765273351968763419/elastic/elastic-agent/internal/pkg/otel/manager/manager_test.go:372 +0x465
github.com/elastic/elastic-agent/internal/pkg/otel/manager.TestOTelManager_Run.func17(0xc000166000)
/opt/buildkite-agent/builds/bk-agent-prod-gcp-1765273351968763419/elastic/elastic-agent/internal/pkg/otel/manager/manager_test.go:699 +0xc72
testing.tRunner(0xc000166000, 0xc0001740c0)
/opt/buildkite-agent/.asdf/installs/golang/1.24.11/go/src/testing/testing.go:1792 +0x226
created by testing.(*T).Run in goroutine 142
/opt/buildkite-agent/.asdf/installs/golang/1.24.11/go/src/testing/testing.go:1851 +0x8f3
```
https://buildkite.com/elastic/elastic-agent/builds/31698#019b027d-4c02-4a92-aa14-27107a3b7585/140-4642
Fix this panic by checking `status` first before use.
Signed-off-by: Florian Lehner <[email protected]>
|
This pull request does not have a backport label. Could you fix it @florianl? 🙏
|
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
swiatekm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a test fix, it doesn't need a changelog entry.
Signed-off-by: Florian Lehner <[email protected]>
Signed-off-by: Florian Lehner <[email protected]>
|
@swiatekm I have removed the changelog entry and updated the tests to use require instead of assert. |
|
@florianl could you also make the |
Signed-off-by: Florian Lehner <[email protected]>
This reverts commit c45475a.
|
I don't have permission to retrigger Buildkite CI nor to look further into the reason of the failed Buildkite CI - therefore, looking for help @elastic/elastic-agent-control-plane |
Buildkite had an issue grabbing an agent for one k8s integration test. I have retriggered the failed step and this time bk managed to get an agent. This should allow the build to go to completion |
💛 Build succeeded, but was flaky
Failed CI Steps
History
cc @florianl |
What does this PR do?
CI tests reveal the following panic:
https://buildkite.com/elastic/elastic-agent/builds/31698#019b027d-4c02-4a92-aa14-27107a3b7585/140-4642
Fix this panic by checking
statusfirst before use.This panic was identified in the CI run of #11671.