diff --git testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java index 8b82497bdaf43694e0e1552e125b5ffdce40f56c..e80656385e371bcb0d33a55c22b214d647efc79d 100644 --- testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java +++ testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java @@ -223,6 +223,16 @@ public synchronized ExecutionContext createExecutionContext() LOG.info("Attempting to create " + numRequired + " nodes"); try { result.addAll(mCloudComputeService.createNodes(Math.min(mMaxHostsPerCreateRequest, numRequired))); + + Set newAddresses = new HashSet(); + for (NodeMetadata node : result) { + newAddresses.addAll(node.getPublicAddresses()); + } + synchronized (mTerminatedHosts) { + for (String newAddress : newAddresses) { + mTerminatedHosts.remove(newAddress); + } + } } catch (RunNodesException e) { error = true; LOG.warn("Error creating nodes", e); @@ -332,6 +342,7 @@ private synchronized void performBackgroundWork() { synchronized (mTerminatedHosts) { terminatedHosts.putAll(mTerminatedHosts); } + LOG.info("Currently tracked terminated hosts: {}", terminatedHosts.keySet().toString()); for (NodeMetadata node : getRunningNodes()) { String ip = publicIpOrHostname(node); if (terminatedHosts.containsKey(ip)) {