You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ge...@apache.org on 2017/02/24 15:18:13 UTC

[2/5] brooklyn-server git commit: JcloudsLocation waitForSshable uses timeout for connections and sessions

JcloudsLocation waitForSshable uses timeout for connections and sessions

Rather than only PROP_SSH_TRIES.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/1a6fd6a9
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/1a6fd6a9
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/1a6fd6a9

Branch: refs/heads/master
Commit: 1a6fd6a920ba23406d28db1240519767fe9dbd98
Parents: bc0d957
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Wed Jan 18 15:54:38 2017 +0000
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Fri Feb 24 14:32:32 2017 +0000

----------------------------------------------------------------------
 .../apache/brooklyn/location/jclouds/JcloudsLocation.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/1a6fd6a9/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
index ab711a9..b221641 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
@@ -2693,15 +2693,21 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
         for (LoginCredentials creds : credentialsToTry) {
             machinesToTry.put(createTemporarySshMachineLocation(hostAndPort, creds, sshProps), creds);
         }
+        final Duration repeaterTimeout = timeout;
         try {
             Callable<Boolean> checker = new Callable<Boolean>() {
                 @Override
                 public Boolean call() {
                     for (Map.Entry<SshMachineLocation, LoginCredentials> entry : machinesToTry.entrySet()) {
                         SshMachineLocation machine = entry.getKey();
+                        Duration statusTimeout = Duration.THIRTY_SECONDS.isShorterThan(repeaterTimeout)
+                                ? Duration.THIRTY_SECONDS
+                                : repeaterTimeout;
                         int exitstatus = machine.execScript(
                                 ImmutableMap.of(
-                                        SshTool.PROP_SSH_TRIES_TIMEOUT.getName(), Duration.THIRTY_SECONDS.toMilliseconds(),
+                                        SshTool.PROP_CONNECT_TIMEOUT.getName(), statusTimeout.toMilliseconds(),
+                                        SshTool.PROP_SESSION_TIMEOUT.getName(), statusTimeout.toMilliseconds(),
+                                        SshTool.PROP_SSH_TRIES_TIMEOUT.getName(), statusTimeout.toMilliseconds(),
                                         SshTool.PROP_SSH_TRIES.getName(), 1),
                                 "check-connectivity",
                                 ImmutableList.of("true"));