Merge PR #5279: Fix IAVL Iterator Race Condition

This commit is contained in:
Alexander Bezobchuk 2019-11-06 06:52:22 -07:00 committed by GitHub
parent 1f4f20c3af
commit 60c4f5c7bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -182,6 +182,7 @@ to detail this new feature and how state transitions occur.
### Bug Fixes
* (iavl) [\#5276](https://github.com/cosmos/cosmos-sdk/issues/5276) Fix potential race condition in `iavlIterator#Close`.
* (cli) [\#4763](https://github.com/cosmos/cosmos-sdk/issues/4763) Fix flag `--min-self-delegation` for staking `EditValidator`
* (keys) Fix ledger custom coin type support bug
* (x/gov) [\#5107](https://github.com/cosmos/cosmos-sdk/pull/5107) Sum validator operator's all voting power when tally votes

View File

@ -421,9 +421,13 @@ func (iter *iavlIterator) Value() []byte {
return val
}
// Implements types.Iterator.
// Close closes the IAVL iterator by closing the quit channel and waiting for
// the iterCh to finish/close.
func (iter *iavlIterator) Close() {
close(iter.quitCh)
// wait iterCh to close
for range iter.iterCh {
}
}
//----------------------------------------