Skip to content
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

fix nil pointer dereference in supervisor example #166

Merged
merged 3 commits into from
Jun 18, 2023

Conversation

haoqixu
Copy link
Member

@haoqixu haoqixu commented Apr 29, 2023

Supervisor.healthCheckTicker is prepared in (*Supervisor).startAgent. If there is no effective config file, we will skip the call of startAgent causing an nil pointer dereference in the loop.

@haoqixu haoqixu requested a review from a team as a code owner April 29, 2023 09:19
@tigrannajaryan
Copy link
Member

Thank you for the PR @haoqixu

Can you provide a test that reproduces this bug?

@haoqixu
Copy link
Member Author

haoqixu commented May 2, 2023

The example in https://opentelemetry.io/blog/2022/opamp/ can reproduce this bug.

@tigrannajaryan
Copy link
Member

@haoqixu thanks for the link. Sorry I was not clear. To accept a bug fix ideally we need an automated test that shows that the bug exists and verifies that the PR fixes it. Will you be able to write a test like that and include in this PR?

@haoqixu
Copy link
Member Author

haoqixu commented May 2, 2023

PTAL

@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Patch coverage: 92.45% and project coverage change: +0.40 🎉

Comparison is base (efddaa2) 76.11% compared to head (8f2e1b9) 76.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #166      +/-   ##
==========================================
+ Coverage   76.11%   76.52%   +0.40%     
==========================================
  Files          24       24              
  Lines        1834     1866      +32     
==========================================
+ Hits         1396     1428      +32     
- Misses        326      327       +1     
+ Partials      112      111       -1     
Impacted Files Coverage Δ
client/internal/mockserver.go 82.35% <85.71%> (+0.31%) ⬆️
server/serverimpl.go 58.92% <94.73%> (+0.37%) ⬆️
client/httpclient.go 95.00% <100.00%> (+0.26%) ⬆️
client/internal/httpsender.go 72.22% <100.00%> (+1.25%) ⬆️
server/callbacks.go 68.18% <100.00%> (-4.55%) ⬇️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
@tigrannajaryan tigrannajaryan merged commit c1eaabc into open-telemetry:main Jun 18, 2023
tigrannajaryan pushed a commit to tigrannajaryan/opamp-go that referenced this pull request Jun 19, 2023
`Supervisor.healthCheckTicker` is prepared in `(*Supervisor).startAgent`. If there is no effective config file, we will skip the call of `startAgent` causing an nil pointer dereference in the loop.
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.

None yet

2 participants