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

More than one iterator? #548

Closed
beansgum opened this issue Aug 13, 2018 · 6 comments
Closed

More than one iterator? #548

beansgum opened this issue Aug 13, 2018 · 6 comments

Comments

@beansgum
Copy link

I have an implementation that uses iterators concurrently. Is there a way to achieve this since I can only open on iterator? I also get an error that an iterator wasn’t closed but I assigned a uuid to every transaction and I printed it out when iterators are opened and closed. Every iterator seems closed but I still get the error

@ghost
Copy link

ghost commented Aug 13, 2018

That doesn't make any sense. Use concurrent transactions, not iterators. If you need write transaction then simply chan the logic.

@beansgum
Copy link
Author

OK. I'd use that. How about the "Unclosed Iterator" that I didn't open? How does that happen. I track every opening and closing and I don't see any unclosed iterator from my side.

@manishrjain
Copy link
Contributor

See this: #522

It could be that you're discarding the transaction before closing iterator. Try to see if you can find some ordering issue in your code, potentially by checking defers.

@beansgum
Copy link
Author

I created a struct which contains my transaction and iterator. Whenever discard is called, I close the iterator and I get error.

@ghost
Copy link

ghost commented Aug 14, 2018

Collins - just use defer iterator.Close() within transaction and you should be fine. seems you have logic ordering issue, this should take care of it.

@beansgum
Copy link
Author

Okay, Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants