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

Nil check named pipe shutdowns #31088

Merged

Conversation

sinkingpoint
Copy link
Contributor

Description:

When the Start method of the named pipe is called, it will create a new named pipe and start listening for connections. If that Start method fails for any reason, some parts of the named pipe will not be initialized. This means that when the Stop method is called (as the collector does when Start fails), it will panic with a nil pointer dereference.

This change adds a couple of nil checks to the Stop method to prevent this panic, because otherwise we just get the SIGSEGV signal, and we never get any error logs.

Link to tracking Issue:

Testing: Running this in prod @ Cloudflare

Documentation:

@sinkingpoint sinkingpoint requested review from djaglowski and a team as code owners February 6, 2024 22:05
When the `Start` method of the named pipe is called, it will create a
new named pipe and start listening for connections. If that
Start method _fails_ for any reason, some parts of the named pipe
will not be initialized. This means that when the `Stop` method is
called (as the collector does when `Start` fails), it will panic with a
nil pointer dereference.

This change adds a couple of nil checks to the `Stop` method
to prevent this panic, because otherwise we just get the SIGSEGV
signal, and we never get any error logs.

Signed-off-by: sinkingpoint <colin@quirl.co.nz>
@djaglowski djaglowski added the ready to merge Code review completed; ready to merge by maintainers label Feb 7, 2024
@codeboten codeboten merged commit b8307e5 into open-telemetry:main Feb 7, 2024
147 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 7, 2024
anthoai97 pushed a commit to anthoai97/opentelemetry-collector-contrib that referenced this pull request Feb 12, 2024
When the `Start` method of the named pipe is called, it will create a
new named pipe and start listening for connections. If that Start method
_fails_ for any reason, some parts of the named pipe will not be
initialized. This means that when the `Stop` method is called (as the
collector does when `Start` fails), it will panic with a nil pointer
dereference.

This change adds a couple of nil checks to the `Stop` method to prevent
this panic, because otherwise we just get the SIGSEGV signal, and we
never get any error logs.

**Testing:** Running this in prod @ Cloudflare

**Documentation:** <Describe the documentation added.>

Signed-off-by: sinkingpoint <colin@quirl.co.nz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/stanza ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants