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

SelectorPool returns Selectors with old keys in them #3963

Closed
mohamedhafez opened this issue Jun 13, 2016 · 1 comment
Closed

SelectorPool returns Selectors with old keys in them #3963

mohamedhafez opened this issue Jun 13, 2016 · 1 comment
Milestone

Comments

@mohamedhafez
Copy link
Contributor

@mohamedhafez mohamedhafez commented Jun 13, 2016

Sometimes when you get a Selector from SelectorPool, it already had old keys in it, which causes issues like jruby/jruby-openssl#93 that me and @kares were working on. Something somewhere is returning selectors to the pool without cleaning up its keys properly, I think possibly this line (perhaps the key needs to be cancelled even if its invalid or it may still show up in selectedKeys() under certain conditions?)

Instead of repeating the key-cleaning code in (at least) the 3 places in jruby and jruby-openssl, I figure the best fix is to do the cleaning inside of SelectorPool#put, so its only done in one place, and done correctly. I've put together #3952 which does this, and have been running it in production and its completely fixed this issue, and I don't see any Selectors with old keys any more, and haven't seen any unwanted side effects

@mohamedhafez
Copy link
Contributor Author

@mohamedhafez mohamedhafez commented Jun 28, 2016

fixed with #3952

@enebo enebo added this to the JRuby 9.1.3.0 milestone Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.