Commit 94fc9d38 authored by Axel Kingsley's avatar Axel Kingsley Committed by GitHub

TxMgr: Rearrange TxMgr closure in Batcher (#9205)

parent 8d0af85c
......@@ -329,6 +329,12 @@ func (bs *BatcherService) Stop(ctx context.Context) error {
}
bs.Log.Info("Stopping batcher")
// close the TxManager first, so that new work is denied, in-flight work is cancelled as early as possible
// (transactions which are expected to be confirmed are still waited for)
if bs.TxManager != nil {
bs.TxManager.Close()
}
var result error
if bs.driver != nil {
if err := bs.driver.StopBatchSubmittingIfRunning(ctx); err != nil {
......@@ -352,9 +358,6 @@ func (bs *BatcherService) Stop(ctx context.Context) error {
result = errors.Join(result, fmt.Errorf("failed to close balance metricer: %w", err))
}
}
if bs.TxManager != nil {
bs.TxManager.Close()
}
if bs.metricsSrv != nil {
if err := bs.metricsSrv.Stop(ctx); err != nil {
......
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