mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-15 23:38:19 +00:00
mdbx: fix possible semaphore exhaustion on cancelled context (#567)
This commit is contained in:
parent
1d6c297797
commit
8fbf01ca91
@ -419,12 +419,6 @@ func (db *MdbxKV) BeginRo(ctx context.Context) (txn kv.Tx, err error) {
|
|||||||
return nil, semErr
|
return nil, semErr
|
||||||
}
|
}
|
||||||
|
|
||||||
// if context cancelled as we acquire the sempahore, it may succeed without blocking
|
|
||||||
// in this case we should return
|
|
||||||
if ctx.Err() != nil {
|
|
||||||
return nil, ctx.Err()
|
|
||||||
}
|
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
db.wg.Add(1)
|
db.wg.Add(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user