Commit fae4e077 authored by Michael de Hoog's avatar Michael de Hoog

Fix batcher panic

parent 9bfaf926
...@@ -290,9 +290,11 @@ func (bs *BatcherService) Stop(ctx context.Context) error { ...@@ -290,9 +290,11 @@ func (bs *BatcherService) Stop(ctx context.Context) error {
bs.Log.Info("Stopping batcher") bs.Log.Info("Stopping batcher")
var result error var result error
if bs.driver != nil {
if err := bs.driver.StopBatchSubmittingIfRunning(ctx); err != nil { if err := bs.driver.StopBatchSubmittingIfRunning(ctx); err != nil {
result = errors.Join(result, fmt.Errorf("failed to stop batch submitting: %w", err)) result = errors.Join(result, fmt.Errorf("failed to stop batch submitting: %w", err))
} }
}
if bs.rpcServer != nil { if bs.rpcServer != nil {
// TODO(7685): the op-service RPC server is not built on top of op-service httputil Server, and has poor shutdown // TODO(7685): the op-service RPC server is not built on top of op-service httputil Server, and has poor shutdown
...@@ -328,7 +330,7 @@ func (bs *BatcherService) Stop(ctx context.Context) error { ...@@ -328,7 +330,7 @@ func (bs *BatcherService) Stop(ctx context.Context) error {
if result == nil { if result == nil {
bs.stopped.Store(true) bs.stopped.Store(true)
bs.driver.Log.Info("Batch Submitter stopped") bs.Log.Info("Batch Submitter stopped")
} }
return result return result
} }
......
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