Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary Logs in sentry removed #10187

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion p2p/sentry/sentry_multi_client/sentry_multi_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ func SentryReconnectAndPumpStreamLoop[TMessage interface{}](
statusData, err := statusDataFactory(ctx)

if err != nil {
logger.Error("SentryReconnectAndPumpStreamLoop: statusDataFactory error", "stream", streamName, "err", err)
if !errors.Is(err, sentry.ErrNoHead) {
logger.Error("SentryReconnectAndPumpStreamLoop: statusDataFactory error", "stream", streamName, "err", err)
}
time.Sleep(time.Second)
continue
}
Expand Down
4 changes: 3 additions & 1 deletion p2p/sentry/status_data_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"github.com/ledgerwatch/erigon/core/types"
)

var ErrNoHead = errors.New("ReadChainHead: ReadCurrentHeader error")

type ChainHead struct {
HeadHeight uint64
HeadTime uint64
Expand Down Expand Up @@ -77,7 +79,7 @@ func (s *StatusDataProvider) GetStatusData(ctx context.Context) (*proto_sentry.S
func ReadChainHeadWithTx(tx kv.Tx) (ChainHead, error) {
header := rawdb.ReadCurrentHeaderHavingBody(tx)
if header == nil {
return ChainHead{}, errors.New("ReadChainHead: ReadCurrentHeader error")
return ChainHead{}, ErrNoHead
}

height := header.Number.Uint64()
Expand Down
Loading