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

[processor/remotetap] Fix memory leak on shutdown #32571

Merged
merged 8 commits into from
Apr 24, 2024

Conversation

crobert-1
Copy link
Member

Description:

The remotetap processor holds a map of channels for writing telemetry data to WebSockets when a client connects. The write process works by blocking on a given channel waiting for telemetry data coming through the processor's pipeline, then writing as soon as it comes in. This however can result in a leaked goroutine that blocks forever if data is not received, which is always the case when shutting down.

This fixes the bug by closing and deleting all channels once all client connections have been shutdown gracefully. This fixes the blocking behavior during shutdown.

This change also enables goleak to help ensure no goroutines are being leaked.

Link to tracking Issue:
#30438

Testing:
All existing tests are passing, as well as added goleak check.

@codeboten codeboten merged commit d86ec75 into open-telemetry:main Apr 24, 2024
168 of 170 checks passed
@github-actions github-actions bot added this to the next release milestone Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants