Skip to content

Commit

Permalink
add details to roTxsLimiter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
battlmonstr committed Apr 11, 2024
1 parent 03edc9d commit 6936ecb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion erigon-lib/kv/mdbx/kv_mdbx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
7 changes: 4 additions & 3 deletions erigon-lib/kv/remotedb/kv_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 6936ecb

Please sign in to comment.