cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject [3/4] git commit: updated refs/heads/master to b4ad38d
Date Mon, 16 May 2016 21:31:55 GMT
Revert "Merge pull request #1534 from shapeblue/niotest-fix"

This reverts commit 9f970f28b18534dffe33196ead60ea861f501fa9, reversing
changes made to 6d0c92be7257afcf5f1a9f4453e3470e0083125d.

This was reverted because it seemed to be related to an issue
when doing a DeployDC, causing an `addHost` error.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f175ad1a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f175ad1a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f175ad1a

Branch: refs/heads/master
Commit: f175ad1ae09d96007aa3b37adcf79d8e4715a9e7
Parents: 4e1f9cd
Author: Will Stevens <williamstevens@gmail.com>
Authored: Mon May 16 17:30:20 2016 -0400
Committer: Will Stevens <williamstevens@gmail.com>
Committed: Mon May 16 17:30:20 2016 -0400

----------------------------------------------------------------------
 .../src/main/java/com/cloud/utils/nio/Link.java |  4 ++--
 .../java/com/cloud/utils/nio/NioConnection.java |  2 --
 .../java/com/cloud/utils/testcase/NioTest.java  | 23 ++++++++------------
 3 files changed, 11 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f175ad1a/utils/src/main/java/com/cloud/utils/nio/Link.java
----------------------------------------------------------------------
diff --git a/utils/src/main/java/com/cloud/utils/nio/Link.java b/utils/src/main/java/com/cloud/utils/nio/Link.java
index da2c0d5..f297d52 100644
--- a/utils/src/main/java/com/cloud/utils/nio/Link.java
+++ b/utils/src/main/java/com/cloud/utils/nio/Link.java
@@ -596,8 +596,8 @@ public class Link {
         while (handshakeStatus != SSLEngineResult.HandshakeStatus.FINISHED
                 && handshakeStatus != SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING)
{
             final long timeTaken = System.currentTimeMillis() - startTimeMills;
-            if (timeTaken > 15000L) {
-                s_logger.warn("SSL Handshake has taken more than 15s to connect to: " + socketChannel.getRemoteAddress()
+
+            if (timeTaken > 60000L) {
+                s_logger.warn("SSL Handshake has taken more than 60s to connect to: " + socketChannel.getRemoteAddress()
+
                         ". Please investigate this connection.");
                 return false;
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f175ad1a/utils/src/main/java/com/cloud/utils/nio/NioConnection.java
----------------------------------------------------------------------
diff --git a/utils/src/main/java/com/cloud/utils/nio/NioConnection.java b/utils/src/main/java/com/cloud/utils/nio/NioConnection.java
index 749e552..6fdb473 100644
--- a/utils/src/main/java/com/cloud/utils/nio/NioConnection.java
+++ b/utils/src/main/java/com/cloud/utils/nio/NioConnection.java
@@ -171,8 +171,6 @@ public abstract class NioConnection implements Callable<Boolean>
{
             } 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;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f175ad1a/utils/src/test/java/com/cloud/utils/testcase/NioTest.java
----------------------------------------------------------------------
diff --git a/utils/src/test/java/com/cloud/utils/testcase/NioTest.java b/utils/src/test/java/com/cloud/utils/testcase/NioTest.java
index 446b1e2..20c31e2 100644
--- a/utils/src/test/java/com/cloud/utils/testcase/NioTest.java
+++ b/utils/src/test/java/com/cloud/utils/testcase/NioTest.java
@@ -61,9 +61,9 @@ public class NioTest {
     private static final Logger LOGGER = Logger.getLogger(NioTest.class);
 
     // Test should fail in due time instead of looping forever
-    private static final int TESTTIMEOUT = 60000;
+    private static final int TESTTIMEOUT = 300000;
 
-    final private int totalTestCount = 4;
+    final private int totalTestCount = 5;
     private int completedTestCount = 0;
 
     private NioServer server;
@@ -71,7 +71,7 @@ public class NioTest {
     private List<NioClient> maliciousClients = new ArrayList<>();
 
     private ExecutorService clientExecutor = Executors.newFixedThreadPool(totalTestCount,
new NamedThreadFactory("NioClientHandler"));;
-    private ExecutorService maliciousExecutor = Executors.newFixedThreadPool(totalTestCount,
new NamedThreadFactory("MaliciousNioClientHandler"));;
+    private ExecutorService maliciousExecutor = Executors.newFixedThreadPool(5*totalTestCount,
new NamedThreadFactory("MaliciousNioClientHandler"));;
 
     private Random randomGenerator = new Random();
     private byte[] testBytes;
@@ -105,18 +105,12 @@ public class NioTest {
             Assert.fail(e.getMessage());
         }
 
-        /**
-         * The malicious client(s) tries to block NioServer's main IO loop
-         * thread until SSL handshake timeout value (from Link class, 15s) after
-         * which the valid NioClient(s) get the opportunity to make connection(s)
-         */
-        for (int i = 0; i < totalTestCount; i++) {
-            final NioClient maliciousClient = new NioMaliciousClient("NioMaliciousTestClient-"
+ i, "127.0.0.1", server.getPort(), 1, new NioMaliciousTestClient());
-            maliciousClients.add(maliciousClient);
-            maliciousExecutor.submit(new ThreadedNioClient(maliciousClient));
-        }
-
         for (int i = 0; i < totalTestCount; i++) {
+            for (int j = 0; j < 4; j++) {
+                final NioClient maliciousClient = new NioMaliciousClient("NioMaliciousTestClient-"
+ i, "127.0.0.1", server.getPort(), 1, new NioMaliciousTestClient());
+                maliciousClients.add(maliciousClient);
+                maliciousExecutor.submit(new ThreadedNioClient(maliciousClient));
+            }
             final NioClient client = new NioClient("NioTestClient-" + i, "127.0.0.1", server.getPort(),
1, new NioTestClient());
             clients.add(client);
             clientExecutor.submit(new ThreadedNioClient(client));
@@ -292,6 +286,7 @@ public class NioTest {
                     LOGGER.info("Server: Received OTHER task");
                 }
             }
+
         }
     }
 }


Mime
View raw message