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

[chore]move googlecloudpubsubreceiver to generated lifecycle tests #29940

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

atoulme
Copy link
Contributor

@atoulme atoulme commented Dec 16, 2023

Related to #27850

@@ -111,6 +111,9 @@ func (receiver *pubsubReceiver) Start(ctx context.Context, _ component.Host) err
}

func (receiver *pubsubReceiver) Shutdown(_ context.Context) error {
if receiver.handler == nil {
return nil
}
receiver.logger.Info("Stopping Google Pubsub receiver")
receiver.handler.CancelNow()
Copy link
Contributor

Choose a reason for hiding this comment

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

the check for nil might be better around this call to still have the logs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don’t think we are stopping anything if we didn’t start, so no logging might be best. Codeowners might know best.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, the handler is the thing that needs to be stopped and will consume resources. So nothing needs to be logged.

@@ -111,6 +111,9 @@ func (receiver *pubsubReceiver) Start(ctx context.Context, _ component.Host) err
}

func (receiver *pubsubReceiver) Shutdown(_ context.Context) error {
if receiver.handler == nil {
return nil
}
receiver.logger.Info("Stopping Google Pubsub receiver")
receiver.handler.CancelNow()
Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, the handler is the thing that needs to be stopped and will consume resources. So nothing needs to be logged.

@alexvanboxel
Copy link
Contributor

lgtm

@codeboten codeboten merged commit 9ebd834 into open-telemetry:main Dec 18, 2023
85 checks passed
@github-actions github-actions bot added this to the next release milestone Dec 18, 2023
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this pull request Jan 10, 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