Commit 5aa14b37 authored by zhiqiangxu's avatar zhiqiangxu Committed by GitHub

op-batcher: fix a deadlock (#13014)

* fix a deadlock

* add comment
parent e52030db
......@@ -557,8 +557,11 @@ func (l *BatchSubmitter) throttlingLoop(ctx context.Context) {
// We'd probably hit this error right after startup, so a short shutdown duration should suffice.
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
// Always returns nil. An error is only returned to expose this function as an RPC.
_ = l.StopBatchSubmitting(ctx)
// Call StopBatchSubmitting in another goroutine to avoid deadlock.
go func() {
// Always returns nil. An error is only returned to expose this function as an RPC.
_ = l.StopBatchSubmitting(ctx)
}()
return
} else if err != nil {
l.Log.Error("SetMaxDASize rpc failed, retrying.", "err", err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment