protected Collection<ModuleDeploymentStatus> processResults(ResultCollector collector) throws InterruptedException {
		Collection<ModuleDeploymentStatus> statuses = collector.getResults();

		// remove the ZK path for any failed deployments
		for (ModuleDeploymentStatus deploymentStatus : statuses) {
			if (deploymentStatus.getState() != ModuleDeploymentStatus.State.deployed) {
				String path = new ModuleDeploymentsPath()
						.setContainer(deploymentStatus.getContainer())
						.setDeploymentUnitName(deploymentStatus.getKey().getGroup())
						.setModuleType(deploymentStatus.getKey().getType().toString())
						.setModuleLabel(deploymentStatus.getKey().getLabel())
						.setModuleSequence(deploymentStatus.getModuleSequenceAsString()).build();
				logger.debug("Unsuccessful deployment: {}; removing path {}", deploymentStatus, path);
				try {
					zkConnection.getClient().delete().deletingChildrenIfNeeded().forPath(path);
				}
				catch (InterruptedException e) {
					throw e;
				}
				catch (KeeperException.NoNodeException e) {
					// this node was already removed (perhaps by the supervisor
					// as a result of the target container departing the cluster);
					// this is safe to ignore
				}
				catch (Exception e) {
					logger.warn("Error while cleaning up failed deployment " + path, e);
				}
			}
		}
		return statuses;
	}
Block the calling thread until all expected results are returned
or until a timeout occurs. Additionally, remove any module deployment
paths for deployments that failed or timed out.

@param collector  ZooKeeper watch used to collect results
@return collection of results for module deployment requests
@throws InterruptedException
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/server/admin/deployment/zk/ModuleDeploymentWriter.java