Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Seeing in the field where whatKilledSelectorThread is null. Tightening up the codepath where this can be null.
  • Loading branch information
kohsuke committed Apr 15, 2015
1 parent 25589f1 commit aabba03
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/org/jenkinsci/remoting/nio/NioChannelHub.java
Expand Up @@ -541,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 @@ -645,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

0 comments on commit aabba03

Please sign in to comment.