-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[chore]move googlecloudpubsubreceiver to generated lifecycle tests #29940
Conversation
@@ -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() |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.
lgtm |
Related to #27850