mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-04-12 20:58:33 +00:00
core/txpool/blobpool: drain and signal pending conversion tasks on shutdown (#33260)
This commit is contained in:
parent
5748dd18e7
commit
a6191d8272
1 changed files with 9 additions and 0 deletions
|
|
@ -183,6 +183,15 @@ func (q *conversionQueue) loop() {
|
|||
log.Debug("Waiting for blobpool billy conversion to exit")
|
||||
<-q.billyTaskDone
|
||||
}
|
||||
// Signal any tasks that were queued for the next batch but never started
|
||||
// so callers blocked in convert() receive an error instead of hanging.
|
||||
for _, t := range txTasks {
|
||||
// Best-effort notify; t.done is a buffered channel of size 1
|
||||
// created by convert(), and we send exactly once per task.
|
||||
t.done <- errors.New("conversion queue closed")
|
||||
}
|
||||
// Drop references to allow GC of the backing array.
|
||||
txTasks = txTasks[:0]
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue