Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AccountMapper.IterateAccounts may leak resource #2105

Closed
4 tasks
goolAdapter opened this issue Aug 21, 2018 · 1 comment · Fixed by #2107
Closed
4 tasks

AccountMapper.IterateAccounts may leak resource #2105

goolAdapter opened this issue Aug 21, 2018 · 1 comment · Fixed by #2107

Comments

@goolAdapter
Copy link

Summary of Bug

AccountMapper.IterateAccounts may leak resource.

Steps to Reproduce

iter := sdk.KVStorePrefixIterator(store, []byte("account:"))

Iterator need to Close after use,this may leak a go routine for iavlIterator.

almost all of Iterator implement is trival,but iavlIterator.Close is no-trival.
see

close(iter.quitCh)

in democoin/oracle/handle.go also has a similar case,but it's a full iterator,here only cause confusion,not incorrect.

iter := sdk.KVStorePrefixIterator(store, prefix)

This Issue is base on tag v0.24.0


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@ValarDragon
Copy link
Contributor

ValarDragon commented Aug 21, 2018

Your totally right! Thanks for catching this. Would you like to submit a PR to fix this?

goolAdapter pushed a commit to goolAdapter/cosmos-sdk that referenced this issue Aug 21, 2018
goolAdapter pushed a commit to goolAdapter/cosmos-sdk that referenced this issue Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants