Skip to content

Commit

Permalink
CLOUDSTACK-9348: Make NioConnectio loop less aggressive
Browse files Browse the repository at this point in the history
- Reverts ea2286 that introduced a wakeup on each connection loop run.
- In SSL handshake code removes delegated tasks to be run in separate threads.

Signed-off-by: Rohit Yadav <[email protected]>
  • Loading branch information
rohityadavcloud committed May 13, 2016
1 parent 2b4b8aa commit 540d957
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion utils/src/main/java/com/cloud/utils/nio/Link.java
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,10 @@ public static boolean doHandshake(final SocketChannel socketChannel, final SSLEn
case NEED_TASK:
Runnable task;
while ((task = sslEngine.getDelegatedTask()) != null) {
new Thread(task).run();
if (s_logger.isTraceEnabled()) {
s_logger.trace("SSL: Running delegated task!");
}
task.run();
}
break;
case FINISHED:
Expand Down
2 changes: 0 additions & 2 deletions utils/src/main/java/com/cloud/utils/nio/NioConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ public Boolean call() throws NioConnectionException {
} catch (final IOException e) {
s_logger.error("Agent will die due to this IOException!", e);
throw new NioConnectionException(e.getMessage(), e);
} finally {
_selector.wakeup();
}
}
_isStartup = false;
Expand Down

0 comments on commit 540d957

Please sign in to comment.