Browse Source

grpcdb: close Iterator/ReverseIterator after use (#3424)

Fixes #3402
pull/3430/head
Anton Kaliaev 6 years ago
committed by GitHub
parent
commit
7457133307
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions
  1. +1
    -0
      CHANGELOG_PENDING.md
  2. +2
    -0
      libs/db/remotedb/grpcdb/server.go

+ 1
- 0
CHANGELOG_PENDING.md View File

@ -47,3 +47,4 @@ Special thanks to external contributors on this release:
- [libs/pubsub] \#951, \#1880 use non-blocking send when dispatching messages [ADR-33](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-033-pubsub.md)
- [p2p] \#3369 do not panic when filter times out
- [cmd] \#3408 Fix `testnet` command's panic when creating non-validator configs (using `--n` flag) (@srmo)
- [libs/db/remotedb/grpcdb] \#3402 Close Iterator/ReverseIterator after use

+ 2
- 0
libs/db/remotedb/grpcdb/server.go View File

@ -138,6 +138,7 @@ func (s *server) SetSync(ctx context.Context, in *protodb.Entity) (*protodb.Noth
func (s *server) Iterator(query *protodb.Entity, dis protodb.DB_IteratorServer) error {
it := s.db.Iterator(query.Start, query.End)
defer it.Close()
return s.handleIterator(it, dis.Send)
}
@ -162,6 +163,7 @@ func (s *server) handleIterator(it db.Iterator, sendFunc func(*protodb.Iterator)
func (s *server) ReverseIterator(query *protodb.Entity, dis protodb.DB_ReverseIteratorServer) error {
it := s.db.ReverseIterator(query.Start, query.End)
defer it.Close()
return s.handleIterator(it, dis.Send)
}


Loading…
Cancel
Save