Skip to content

Commit f12254e

Browse files
author
Rohit Yadav
committed
Merge pull request #18 from shapeblue/nio-fix-cpu
utils: Fix NioConnection aggressive usage
2 parents 0a6f930 + e35e7e4 commit f12254e

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

utils/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@
178178
<excludes>
179179
<exclude>com/cloud/utils/testcase/*TestCase*</exclude>
180180
<exclude>com/cloud/utils/db/*Test*</exclude>
181+
<exclude>com/cloud/utils/testcase/NioTest.java</exclude>
181182
</excludes>
182183
</configuration>
183184
</plugin>

utils/src/com/cloud/utils/nio/Link.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ public static boolean doHandshake(final SocketChannel socketChannel, final SSLEn
617617
case NEED_TASK:
618618
Runnable task;
619619
while ((task = sslEngine.getDelegatedTask()) != null) {
620-
new Thread(task).run();
620+
task.run();
621621
}
622622
break;
623623
case FINISHED:

utils/src/com/cloud/utils/nio/NioConnection.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ public void run() {
170170
processTodos();
171171
} catch (Throwable e) {
172172
s_logger.warn("Caught an exception but continuing on.", e);
173-
} finally {
174-
_selector.wakeup();
175173
}
176174
}
177175
synchronized (_thread) {

0 commit comments

Comments
 (0)