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

mohamedhafez opened this Issue Jun 13, 2016 · 1 comment


None yet
2 participants

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


This comment has been minimized.

Show comment
Hide comment

mohamedhafez Jun 28, 2016


fixed with #3952


mohamedhafez commented Jun 28, 2016

fixed with #3952

@enebo enebo added this to the JRuby milestone Aug 26, 2016

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