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

[exporter/loadbalancing] Do not block resolver by the exporter shutdown #31602

Merged

Conversation

dmitryax
Copy link
Member

@dmitryax dmitryax commented Mar 5, 2024

This resolves the issues seen in #31410 after merging #31456

@dmitryax dmitryax requested a review from jpkrohling as a code owner March 5, 2024 18:05
@dmitryax dmitryax requested a review from a team March 5, 2024 18:05
@dmitryax dmitryax added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Mar 5, 2024
@dmitryax dmitryax force-pushed the lb-exporter-shutdown-asyncronously branch 2 times, most recently from 903b520 to 38aca5c Compare March 5, 2024 18:09
@dmitryax dmitryax force-pushed the lb-exporter-shutdown-asyncronously branch from 38aca5c to 679949f Compare March 5, 2024 18:12
exp := lb.exporters[existing]
// Shutdown the exporter asynchronously to avoid blocking the resolver
go func() {
_ = exp.Shutdown(ctx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with this, but isn't it cleaner to use context.WithTimeout wrapping the context? Would Shutdown respect the timeout?

Copy link
Member Author

@dmitryax dmitryax Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what's the need for this. With all the locks this shutdown can block consumes which supposed to be handled by other available sub-exporters. If we kill it by timeout, we introduce the same panics back. I think we should mark the sub-exporter as "turned off" and shut it down asynchronously once it handles all the current requests.

@dmitryax
Copy link
Member Author

dmitryax commented Mar 7, 2024

Merging it as is since I believe it's an important fix based on the feedback #31410. I'm happy to address any other feedback as a follow-up

@dmitryax dmitryax merged commit dbae3a1 into open-telemetry:main Mar 7, 2024
142 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 7, 2024
DougManton pushed a commit to DougManton/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/loadbalancing Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants