Skip to content

Commit 4730e13

Browse files
sashass1315prestoalvarez
authored andcommitted
core/txpool/blobpool: drain and signal pending conversion tasks on shutdown (ethereum#33260)
1 parent 906e7c8 commit 4730e13

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/txpool/blobpool/conversion.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,15 @@ func (q *conversionQueue) loop() {
183183
log.Debug("Waiting for blobpool billy conversion to exit")
184184
<-q.billyTaskDone
185185
}
186+
// Signal any tasks that were queued for the next batch but never started
187+
// so callers blocked in convert() receive an error instead of hanging.
188+
for _, t := range txTasks {
189+
// Best-effort notify; t.done is a buffered channel of size 1
190+
// created by convert(), and we send exactly once per task.
191+
t.done <- errors.New("conversion queue closed")
192+
}
193+
// Drop references to allow GC of the backing array.
194+
txTasks = txTasks[:0]
186195
return
187196
}
188197
}

0 commit comments

Comments
 (0)