|
@@ -48,6 +48,7 @@ import org.cobbzilla.util.io.TempDir; |
|
|
import org.cobbzilla.util.system.Command; |
|
|
import org.cobbzilla.util.system.Command; |
|
|
import org.cobbzilla.util.system.CommandResult; |
|
|
import org.cobbzilla.util.system.CommandResult; |
|
|
import org.cobbzilla.util.system.CommandShell; |
|
|
import org.cobbzilla.util.system.CommandShell; |
|
|
|
|
|
import org.cobbzilla.wizard.api.ApiException; |
|
|
import org.cobbzilla.wizard.cache.redis.RedisService; |
|
|
import org.cobbzilla.wizard.cache.redis.RedisService; |
|
|
import org.cobbzilla.wizard.validation.MultiViolationException; |
|
|
import org.cobbzilla.wizard.validation.MultiViolationException; |
|
|
import org.cobbzilla.wizard.validation.SimpleViolationException; |
|
|
import org.cobbzilla.wizard.validation.SimpleViolationException; |
|
@@ -352,6 +353,7 @@ public class StandardNetworkService implements NetworkService { |
|
|
// wait for node to be ready |
|
|
// wait for node to be ready |
|
|
final long readyStart = now(); |
|
|
final long readyStart = now(); |
|
|
boolean ready = false; |
|
|
boolean ready = false; |
|
|
|
|
|
Exception lastEx = null; |
|
|
BubbleNodeClient nodeClient = null; |
|
|
BubbleNodeClient nodeClient = null; |
|
|
while (now() - readyStart < NODE_READY_TIMEOUT) { |
|
|
while (now() - readyStart < NODE_READY_TIMEOUT) { |
|
|
sleep(SECONDS.toMillis(2), "newNode: waiting for node ("+node.id()+") to be ready"); |
|
|
sleep(SECONDS.toMillis(2), "newNode: waiting for node ("+node.id()+") to be ready"); |
|
@@ -365,9 +367,18 @@ public class StandardNetworkService implements NetworkService { |
|
|
} |
|
|
} |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
log.warn("newNode: node ("+node.id()+") error checking if ready: "+shortError(e)); |
|
|
log.warn("newNode: node ("+node.id()+") error checking if ready: "+shortError(e)); |
|
|
|
|
|
lastEx = e; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (!ready) { |
|
|
if (!ready) { |
|
|
|
|
|
if (lastEx != null) { |
|
|
|
|
|
var responseStatus = ""; |
|
|
|
|
|
if (lastEx instanceof ApiException) { |
|
|
|
|
|
responseStatus = " (HTTP status: " |
|
|
|
|
|
+ String.valueOf(((ApiException) lastEx).getResponse().status) + ")"; |
|
|
|
|
|
} |
|
|
|
|
|
log.warn("newNode: the last exception in checking if ready" + responseStatus, lastEx); |
|
|
|
|
|
} |
|
|
return die("newNode: timeout waiting for node ("+node.id()+") to be ready"); |
|
|
return die("newNode: timeout waiting for node ("+node.id()+") to be ready"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|