Skip to content

Commit

Permalink
simplify exec loop: lazy senders recovery (#13086)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Dec 12, 2024
1 parent 2fb7108 commit e969d4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cmd/state/exec3/historical_trace_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ func NewHistoricalTraceWorkers(consumer TraceConsumer, cfg *ExecArgs, ctx contex
cancel()
g.Wait()
rws.Close()
reducerGroup.Wait()
if err := reducerGroup.Wait(); err != nil {
panic(err)
}
for _, w := range workers {
w.ResetTx(nil)
}
Expand All @@ -342,7 +344,7 @@ func processResultQueueHistorical(consumer TraceConsumer, rws *state.ResultsQueu
for rwsIt.HasNext(outputTxNum) {
txTask := rwsIt.PopNext()
if txTask.Error != nil {
return outputTxNum, false, err
return outputTxNum, false, txTask.Error
}

if txTask.TxIndex >= 0 && !txTask.Final {
Expand Down
4 changes: 2 additions & 2 deletions eth/stagedsync/stage_custom_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ func customTraceBatch(ctx context.Context, cfg *exec3.ExecArgs, tx kv.TemporalRw
var m runtime.MemStats
if err := exec3.CustomTraceMapReduce(fromBlock, toBlock, exec3.TraceConsumer{
NewTracer: func() exec3.GenericTracer { return nil },
Reduce: func(txTask *state.TxTask, tx kv.Tx) (err error) {
Reduce: func(txTask *state.TxTask, tx kv.Tx) error {
if txTask.Error != nil {
return err
return txTask.Error
}

if txTask.Tx != nil {
Expand Down

0 comments on commit e969d4a

Please sign in to comment.