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

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

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants