You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here and just below, errorKeyList, a List<ErrorKey>, is queried for containment of fptr.fd() (a ChannelFD). Perhaps, instead, pendingReadFDs or one of the other List<ChannelFD> fields in the file should be checked instead?
The text was updated successfully, but these errors were encountered:
The logic here is a bit misleading. The code here is largely in place just for matching up with the MRI implementation of select.
In JRuby, no IO are ever put into the errorKeyList which means none of them will ever trigger the logic you pointed out. This is because there's no logic in the JDK's Selector to select streams for errors. We just go through the motions, as mentioned earlier in the file, but since there's no way to register for errors...we don't.
The logic could probably be boiled down to just the side effect calls (such as verifying opennes of IO passed in the error argument), but it would only be to clean up the code (which is a valid reason).
To be honest, this whole thing should be rewritten for efficiency, but the complexities of handling both selectable and non-selectable, native and JDK-provided streams has kept me from tackling it.
Closing this for now. I tried a simple optimization that fast-paths single read selects and it seemed to have little effect on overall performance. The dummy error logic will remain in place for now, since it's rarely used and reflects how MRI's select is implemented.
Coming from #4860
jruby/core/src/main/java/org/jruby/util/io/SelectExecutor.java
Line 212 in 0781932
Here and just below,
errorKeyList
, aList<ErrorKey>
, is queried for containment offptr.fd()
(aChannelFD
). Perhaps, instead,pendingReadFDs
or one of the otherList<ChannelFD>
fields in the file should be checked instead?The text was updated successfully, but these errors were encountered: