Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2df3c2fdb71e
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3f97c7aafb68
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Feb 3, 2017

  1. Copy the full SHA
    ac1d2da View commit details

Commits on Feb 4, 2017

  1. Merge pull request #4471 from cheister/file-descriptor-leak

    Make sure to iterate over all keys when cancelling keys in a SelectorPool
    headius authored Feb 4, 2017
    Copy the full SHA
    3f97c7a View commit details
Showing with 5 additions and 2 deletions.
  1. +5 −2 core/src/main/java/org/jruby/util/io/SelectorPool.java
7 changes: 5 additions & 2 deletions core/src/main/java/org/jruby/util/io/SelectorPool.java
Original file line number Diff line number Diff line change
@@ -85,8 +85,11 @@ public synchronized Selector get(SelectorProvider provider) throws IOException{
* @param selector the selector to put back
*/
public void put(Selector selector) {
Iterator<SelectionKey> key_iterator = selector.keys().iterator();
while(key_iterator.hasNext()) key_iterator.next().cancel();
for (SelectionKey key : selector.keys()) {
if (key != null) {
key.cancel();
}
}

try {
selector.selectNow();