From 6936ecb99b02f2cdfba86caa72bdcc0ef19c6519 Mon Sep 17 00:00:00 2001 From: battlmonstr Date: Thu, 11 Apr 2024 14:18:29 +0200 Subject: [PATCH] add details to roTxsLimiter errors --- erigon-lib/kv/mdbx/kv_mdbx.go | 2 +- erigon-lib/kv/remotedb/kv_remote.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/erigon-lib/kv/mdbx/kv_mdbx.go b/erigon-lib/kv/mdbx/kv_mdbx.go index 5f8bfde99e8..5a901f9b9ec 100644 --- a/erigon-lib/kv/mdbx/kv_mdbx.go +++ b/erigon-lib/kv/mdbx/kv_mdbx.go @@ -594,7 +594,7 @@ func (db *MdbxKV) BeginRo(ctx context.Context) (txn kv.Tx, err error) { // will return nil err if context is cancelled (may appear to acquire the semaphore) if semErr := db.roTxsLimiter.Acquire(ctx, 1); semErr != nil { db.trackTxEnd() - return nil, semErr + return nil, fmt.Errorf("mdbx.MdbxKV.BeginRo: roTxsLimiter error %w", semErr) } defer func() { diff --git a/erigon-lib/kv/remotedb/kv_remote.go b/erigon-lib/kv/remotedb/kv_remote.go index 7df14ae88de..dc380760de8 100644 --- a/erigon-lib/kv/remotedb/kv_remote.go +++ b/erigon-lib/kv/remotedb/kv_remote.go @@ -24,13 +24,14 @@ import ( "runtime" "unsafe" - "github.com/ledgerwatch/erigon-lib/kv/iter" - "github.com/ledgerwatch/erigon-lib/kv/order" "github.com/ledgerwatch/log/v3" "golang.org/x/sync/semaphore" "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" + "github.com/ledgerwatch/erigon-lib/kv/iter" + "github.com/ledgerwatch/erigon-lib/kv/order" + "github.com/ledgerwatch/erigon-lib/gointerfaces" "github.com/ledgerwatch/erigon-lib/gointerfaces/grpcutil" "github.com/ledgerwatch/erigon-lib/gointerfaces/remote" @@ -160,7 +161,7 @@ func (db *DB) BeginRo(ctx context.Context) (txn kv.Tx, err error) { } if semErr := db.roTxsLimiter.Acquire(ctx, 1); semErr != nil { - return nil, semErr + return nil, fmt.Errorf("remotedb.DB.BeginRo: roTxsLimiter error %w", semErr) } defer func() {