Skip to content

Commit

Permalink
add rollback tx at GetVoteOnHash #8637 (#8660)
Browse files Browse the repository at this point in the history
At `turbo/jsonrpc/bor_snapshot.go:239` creates read only transaction and
acquire semaphore but does not rollback or commit transaction and
unrelease semaphore lock. Over time, this will result in the locking all
of semaphore resources. Any other resources can't acquire semaphore.

I added defer function to rollback transaction to release semaphore.
  • Loading branch information
dlscjf151 authored Nov 6, 2023
1 parent 1185587 commit 0df5a6c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions turbo/jsonrpc/bor_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ func (api *BorImpl) GetVoteOnHash(ctx context.Context, starBlockNr uint64, endBl
if err != nil {
return false, err
}
defer tx.Rollback()

service := whitelist.GetWhitelistingService()

Expand Down

0 comments on commit 0df5a6c

Please sign in to comment.