Skip to content

Commit

Permalink
Merge pull request #38 from jenkinsci/JENKINS-22932
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed Apr 16, 2015
2 parents ba844a6 + aabba03 commit 281ee8e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/java/org/jenkinsci/remoting/nio/NioChannelHub.java
Expand Up @@ -485,8 +485,7 @@ protected CommandTransport makeTransport(InputStream is, OutputStream os, Mode m
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
}

if (selectorThread==null)
throw new IOException("NioChannelHub is not currently running",whatKilledSelectorThread);
ensureValid();

NioTransport t;
if (r==w) t = new MonoNioTransport(getName(),r,cap);
Expand Down Expand Up @@ -542,6 +541,7 @@ public void run() {
selectorThread.setName("NioChannelHub keys=" + selector.keys().size() + " gen=" + (gen++) + ": " + oldName);
selector.select();
} catch (IOException e) {
whatKilledSelectorThread = e;
LOGGER.log(WARNING, "Failed to select", e);
abortAll(e);
return;
Expand Down Expand Up @@ -646,18 +646,20 @@ public void run() {
// TODO: what happens to all the registered ChannelPairs? don't we need to shut them down?
whatKilledSelectorThread = e;
} catch (RuntimeException e) {
abortAll(e);
LOGGER.log(WARNING, "Unexpected shutdown of the selector thread", e);
whatKilledSelectorThread = e;
LOGGER.log(WARNING, "Unexpected shutdown of the selector thread", e);
abortAll(e);
throw e;
} catch (Error e) {
abortAll(e);
LOGGER.log(WARNING, "Unexpected shutdown of the selector thread", e);
whatKilledSelectorThread = e;
LOGGER.log(WARNING, "Unexpected shutdown of the selector thread", e);
abortAll(e);
throw e;
} finally {
selectorThread.setName(oldName);
selectorThread = null;
if (whatKilledSelectorThread==null)
whatKilledSelectorThread = new AssertionError("NioChannelHub shouldn't exit normally");
}
}

Expand Down

2 comments on commit 281ee8e

@dimacus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the status of this patch?

@kohsuke
Copy link
Member Author

@kohsuke kohsuke commented on 281ee8e Jul 7, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Released as 1.51.

Please sign in to comment.