-
Notifications
You must be signed in to change notification settings - Fork 52
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
Limit number of open sessions #165
Conversation
This is a hack because we're relying on session timeout behavior. Recommend ref-counting API that releases refs when block-height changes.
Test passes locally ... re-running 🧐 |
I'm noticing that failing test is potentially non-deterministic. Did I break something, or was this always flaky? Test passes on my laptop, so I am unable to easily answer this with |
tests passed now. sadly, geth tests are notoriously flaky. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Could you add a test?
nice code and comments. is there a good way to write a test ensuring it works as expected? |
Added unit tests. @metachris I think it's a good idea to hook in a envvar flag here, but I'd like to do it in a separate PR because it'll affect a different set of modules. Merging now and following up with that change. |
📝 Summary
Use a semaphore channel to limit the number of open sessions. This is a hack because we're relying on session timeout behavior. Recommend ref-counting API that releases refs when block-height changes in near-term future.
Resolves #153
📚 References