-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Better handling of fatal Selector failures #4798
Comments
I think we must make an effort to exclude (and replace) the failed selector from I understand that if a client may trigger a selector failure that is a DoS attack and a JVM bug, but I think we must respect the fact that a selector may fail because its APIs throw @gregw your thoughts? |
As per our hangout conversation, my thoughts are as follows:
I think our priorities are:
|
Maybe we could try and/or document to check other
I wonder if adding |
Implemented selector recovery by transferring all keys to a newly created selector. Updated code so that it does not assume that the SelectionKey never changes.
Thank you for the update. Can you provide more detail about what the fix is doing specifically, any performance impact it has and what build you are intending to put it in? Will you have something for @Amarendraar23 to test? |
Updates after review. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Is there any performance impact it has and what build you are intending to put it in? Will you have something for @Amarendraar23 to test? |
More updates after review. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
…or_failures Issue #4798 - Recover from Selector Failures
@lorban and I have done a couple of JMH benchmarks for both socket open/close and HTTP/1.0 requests (the worst cases for this change) and could not see any relevant performance difference - we checked with PerfNorm and PerfAsm profilers as well as load test throughput. @Amarendraar23 can you please test the current |
@Amarendraar23 news about the testing? |
@sbordet, thank you for checking in. We are still working through testing at this time. We did initial testing and it seems ok but we are going to have our QA team test it as well. We'll let you know what happens. |
@BrownKathy we are preparing for the Jetty 9.4.29 release, probably early next week. |
@BrownKathy @Amarendraar23 news? |
@sbordet, we are still testing and need to build some new environments. We will provide an update as soon as possible. |
This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed due to it having no activity. |
Jetty version
9.4.x
Description
Various
java.nio.channels.Selector
APIs throwIOException
, such asSelector.select()
.However, fatal selector failures should not happen, and recent work especially on Java 13 (see https://mail.openjdk.java.net/pipermail/nio-dev/2020-February/007051.html), made sure that it was the case implementation wise, although the API signature still allows exceptions to be thrown.
Jetty does not handle well fatal selector failures.
If a
ManagedSelector
fails, Jetty exits the selector thread but leaves theManagedSelector
in the array of selectors inSelectorManager._selectors
.A new connection may arrive and be assigned to the failed selector, ending up in its update queue which will never be drained, since the selector thread has exited already.
#3989 introduced some overridable behavior in
ManagedSelector
butSelectorManager
still references the failed selector.The text was updated successfully, but these errors were encountered: