homatthew commented on code in PR #3602: URL: https://github.com/apache/gobblin/pull/3602#discussion_r1026996560
########## gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java: ########## @@ -544,23 +544,25 @@ void connectHelixManagerWithRetry() { private void addInstanceTags() { HelixManager receiverManager = getReceiverManager(); if (receiverManager.isConnected()) { - // The helix instance associated with this container should be consistent on helix tag - List<String> existedTags = receiverManager.getClusterManagmentTool() - .getInstanceConfig(this.clusterName, this.helixInstanceName).getTags(); - Set<String> desiredTags = new HashSet<>( - ConfigUtils.getStringList(this.clusterConfig, GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY)); - if (!desiredTags.isEmpty()) { - // Remove tag assignments for the current Helix instance from a previous run - for (String tag : existedTags) { - if (!desiredTags.contains(tag)) - receiverManager.getClusterManagmentTool().removeInstanceTag(this.clusterName, this.helixInstanceName, tag); - logger.info("Removed unrelated helix tag {} for instance {}", tag, this.helixInstanceName); + try { + Set<String> desiredTags = new HashSet<>(ConfigUtils.getStringList(this.clusterConfig, GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY)); + if (!desiredTags.isEmpty()) { + // The helix instance associated with this container should be consistent on helix tag + List<String> existedTags = + receiverManager.getClusterManagmentTool().getInstanceConfig(this.clusterName, this.helixInstanceName).getTags(); Review Comment: Correct. The current implementation doesn't affect streaming logic and should work. I am pointing out that a missing instance config is an indication of a larger problem. i.e. I don't think this change addresses the core issue which is that we are missing an instance config which causes the exception. ``` instance [instance] does not exist in cluster [cluster] ``` ########## gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java: ########## @@ -544,23 +544,25 @@ void connectHelixManagerWithRetry() { private void addInstanceTags() { HelixManager receiverManager = getReceiverManager(); if (receiverManager.isConnected()) { - // The helix instance associated with this container should be consistent on helix tag - List<String> existedTags = receiverManager.getClusterManagmentTool() - .getInstanceConfig(this.clusterName, this.helixInstanceName).getTags(); - Set<String> desiredTags = new HashSet<>( - ConfigUtils.getStringList(this.clusterConfig, GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY)); - if (!desiredTags.isEmpty()) { - // Remove tag assignments for the current Helix instance from a previous run - for (String tag : existedTags) { - if (!desiredTags.contains(tag)) - receiverManager.getClusterManagmentTool().removeInstanceTag(this.clusterName, this.helixInstanceName, tag); - logger.info("Removed unrelated helix tag {} for instance {}", tag, this.helixInstanceName); + try { + Set<String> desiredTags = new HashSet<>(ConfigUtils.getStringList(this.clusterConfig, GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY)); + if (!desiredTags.isEmpty()) { Review Comment: Does non standalone gobblin mean yarn? Does that mean all usages of yarn don't use the GobblinYarnTaskRunner? ########## gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java: ########## @@ -544,23 +544,27 @@ void connectHelixManagerWithRetry() { private void addInstanceTags() { HelixManager receiverManager = getReceiverManager(); if (receiverManager.isConnected()) { - // The helix instance associated with this container should be consistent on helix tag - List<String> existedTags = receiverManager.getClusterManagmentTool() - .getInstanceConfig(this.clusterName, this.helixInstanceName).getTags(); - Set<String> desiredTags = new HashSet<>( - ConfigUtils.getStringList(this.clusterConfig, GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY)); - if (!desiredTags.isEmpty()) { - // Remove tag assignments for the current Helix instance from a previous run - for (String tag : existedTags) { - if (!desiredTags.contains(tag)) - receiverManager.getClusterManagmentTool().removeInstanceTag(this.clusterName, this.helixInstanceName, tag); - logger.info("Removed unrelated helix tag {} for instance {}", tag, this.helixInstanceName); + try { + Set<String> desiredTags = new HashSet<>( + ConfigUtils.getStringList(this.clusterConfig, GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY)); + if (!desiredTags.isEmpty()) { + // The helix instance associated with this container should be consistent on helix tag + List<String> existedTags = receiverManager.getClusterManagmentTool() + .getInstanceConfig(this.clusterName, this.helixInstanceName).getTags(); + // Remove tag assignments for the current Helix instance from a previous run + for (String tag : existedTags) { + if (!desiredTags.contains(tag)) { + receiverManager.getClusterManagmentTool().removeInstanceTag(this.clusterName, this.helixInstanceName, tag); + logger.info("Removed unrelated helix tag {} for instance {}", tag, this.helixInstanceName); + } + } + desiredTags.forEach(desiredTag -> receiverManager.getClusterManagmentTool().addInstanceTag(this.clusterName, this.helixInstanceName, desiredTag)); Review Comment: Forgot to change this white space back -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@gobblin.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org