mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 15:46:43 +00:00
fix: properly release pipeline stages (#783)
This commit is contained in:
parent
34162effbc
commit
e6cc960f2f
3 changed files with 7 additions and 3 deletions
|
|
@ -401,7 +401,7 @@ func (w *worker) collectPendingL1Messages(startIndex uint64) []types.L1MessageTx
|
|||
func (w *worker) startNewPipeline(timestamp int64) {
|
||||
|
||||
if w.currentPipeline != nil {
|
||||
w.currentPipeline.Kill()
|
||||
w.currentPipeline.Release()
|
||||
w.currentPipeline = nil
|
||||
}
|
||||
|
||||
|
|
@ -586,6 +586,7 @@ func (w *worker) handlePipelineResult(res *pipeline.Result) error {
|
|||
if res != nil && res.FinalBlock != nil {
|
||||
w.updateSnapshot(res.FinalBlock)
|
||||
}
|
||||
w.currentPipeline.Release()
|
||||
w.currentPipeline = nil
|
||||
return nil
|
||||
}
|
||||
|
|
@ -750,6 +751,7 @@ func (w *worker) commit(res *pipeline.Result) error {
|
|||
// Broadcast the block and announce chain insertion event
|
||||
w.mux.Post(core.NewMinedBlockEvent{Block: block})
|
||||
|
||||
w.currentPipeline.Release()
|
||||
w.currentPipeline = nil
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import (
|
|||
const (
|
||||
VersionMajor = 5 // Major version component of the current release
|
||||
VersionMinor = 3 // Minor version component of the current release
|
||||
VersionPatch = 27 // Patch version component of the current release
|
||||
VersionPatch = 28 // Patch version component of the current release
|
||||
VersionMeta = "mainnet" // Version metadata to append to the version string
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -165,9 +165,11 @@ func (p *Pipeline) TryPushTxn(tx *types.Transaction) (*Result, error) {
|
|||
}
|
||||
}
|
||||
|
||||
func (p *Pipeline) Kill() {
|
||||
// Release releases all resources related to the pipeline
|
||||
func (p *Pipeline) Release() {
|
||||
if p.txnQueue != nil {
|
||||
close(p.txnQueue)
|
||||
p.txnQueue = nil
|
||||
}
|
||||
|
||||
select {
|
||||
|
|
|
|||
Loading…
Reference in a new issue