From 06e77d17059ca9bd7a9336d9d7fde05245e6d5ea Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Tue, 12 Dec 2023 17:07:12 +0700 Subject: [PATCH] don't log cancelation error at graceful shutdown (#8943) --- diagnostics/diagnostic.go | 3 --- turbo/execution/eth1/ethereum_execution.go | 9 +++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/diagnostics/diagnostic.go b/diagnostics/diagnostic.go index ff49297e8..98191d7f9 100644 --- a/diagnostics/diagnostic.go +++ b/diagnostics/diagnostic.go @@ -2,7 +2,6 @@ package diagnostics import ( "context" - "fmt" "net/http" "github.com/ledgerwatch/erigon-lib/common" @@ -55,8 +54,6 @@ func (d *DiagnosticClient) runSnapshotListener() { d.snapshotDownload.Sys = info.Sys d.snapshotDownload.DownloadFinished = info.DownloadFinished - fmt.Println("snapshotDownload", d.snapshotDownload) - if info.DownloadFinished { return } diff --git a/turbo/execution/eth1/ethereum_execution.go b/turbo/execution/eth1/ethereum_execution.go index 5f07c324d..baa1e8e82 100644 --- a/turbo/execution/eth1/ethereum_execution.go +++ b/turbo/execution/eth1/ethereum_execution.go @@ -2,6 +2,7 @@ package eth1 import ( "context" + "errors" "math/big" "github.com/ledgerwatch/erigon-lib/chain" @@ -230,11 +231,15 @@ func (e *EthereumExecutionModule) Start(ctx context.Context) { defer e.semaphore.Release(1) // Run the forkchoice if err := e.executionPipeline.Run(e.db, nil, true); err != nil { - e.logger.Error("Could not start execution service", "err", err) + if !errors.Is(err, context.Canceled) { + e.logger.Error("Could not start execution service", "err", err) + } return } if err := e.executionPipeline.RunPrune(e.db, nil, true); err != nil { - e.logger.Error("Could not start execution service", "err", err) + if !errors.Is(err, context.Canceled) { + e.logger.Error("Could not start execution service", "err", err) + } return } }