Skip to content

op-batcher: exit forcefully instead of "stopping", when throttle endpoint unavailable#17909

Closed
geoknee wants to merge 1 commit intodevelopfrom
gk/batcher-crit-exit
Closed

op-batcher: exit forcefully instead of "stopping", when throttle endpoint unavailable#17909
geoknee wants to merge 1 commit intodevelopfrom
gk/batcher-crit-exit

Conversation

@geoknee
Copy link
Copy Markdown
Contributor

@geoknee geoknee commented Oct 17, 2025

No description provided.

@geoknee
Copy link
Copy Markdown
Contributor Author

geoknee commented Oct 17, 2025

I think to do this properly we need to have the throttling goroutine signal to the main process that it needs to shutdown.

Comment on lines -632 to +633
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
// Call StopBatchSubmitting in another goroutine to avoid deadlock.
go func() {
_ = l.StopBatchSubmitting(ctx)
}()
os.Exit(1) //nolint:gocritic // this is a shutdown error
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this is a viable solution. In general, we only want the batcher main to shutdown. But e.g. if the BatchSubmitter is used in a test environment, we surely don't want to kill the whole process.

I think we just need to fix how a stopped batch submitter shuts down, e.g. that all the goroutines that were started stop and the main routines properly returns.

@geoknee
Copy link
Copy Markdown
Contributor Author

geoknee commented Oct 18, 2025

#17924

@geoknee geoknee closed this Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants