Skip to content

Commit

Permalink
go/worker/compute/executor: Unlock drain after rt scheduling finishes
Browse files Browse the repository at this point in the history
  • Loading branch information
peternose committed Nov 7, 2023
1 parent 89e134b commit 3bae70e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go/worker/compute/executor/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ func (n *Node) scheduleBatch(ctx context.Context, round uint64, force bool) {
// Ask the transaction pool to get a batch of transactions for us and see if we should be
// proposing a new batch to other nodes.
batch := n.commonNode.TxPool.GetSchedulingSuggestion(rtInfo.Features.ScheduleControl.InitialBatchSize)
defer n.commonNode.TxPool.FinishScheduling()
switch {
case force:
// Batch flush timeout expired, schedule empty batch.
Expand All @@ -412,6 +411,7 @@ func (n *Node) scheduleBatch(ctx context.Context, round uint64, force bool) {
default:
// No need to schedule a batch.
n.logger.Debug("not scheduling, no transactions")
n.commonNode.TxPool.FinishScheduling()
return
}

Expand All @@ -431,6 +431,7 @@ func (n *Node) scheduleBatch(ctx context.Context, round uint64, force bool) {
go func() {
defer close(done)
n.startSchedulingBatch(ctx, batch)
n.commonNode.TxPool.FinishScheduling()
}()
}

Expand Down

0 comments on commit 3bae70e

Please sign in to comment.