nicknezis commented on a change in pull request #3653:
URL: https://github.com/apache/incubator-heron/pull/3653#discussion_r550404130



##########
File path: 
heron/schedulers/src/java/org/apache/heron/scheduler/kubernetes/V1Controller.java
##########
@@ -238,10 +245,18 @@ boolean deleteService() {
         throw new TopologyRuntimeManagementException(
             KubernetesUtils.errorMessageFromResponse(response));
       }
-    } catch (IOException | ApiException e) {
-      KubernetesUtils.logExceptionWithDetails(LOG, "Error deleting topology 
service", e);
+    } catch (ApiException e) {
+      if (e.getCode() == HTTP_NOT_FOUND) {
+        LOG.log(Level.INFO, "Kubernetes headless service does not exist for 
Topology: "
+                + getTopologyName());
+        return true;
+      }
+    } catch (IOException e) {

Review comment:
       I'm not 100% sure, but I think it's best not to catch `Exception`. For 
example, `OutOfMemoryException` probably shouldn't be handled in this catch.
   
   ```
   Catching Exception will catch both checked and runtime exceptions. Runtime 
exceptions represent problems that are a direct result of a programming 
problem, and as such shouldn't be caught since it can't be reasonably expected 
to recover from them or handle them.
   ```




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to