[ 
https://issues.apache.org/jira/browse/GOBBLIN-1656?focusedWorklogId=793062&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-793062
 ]

ASF GitHub Bot logged work on GOBBLIN-1656:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Jul/22 07:20
            Start Date: 20/Jul/22 07:20
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3516:
URL: https://github.com/apache/gobblin/pull/3516#discussion_r925256213


##########
gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigV2ResourceLocalHandler.java:
##########
@@ -83,11 +83,10 @@ public CreateKVResponse createFlowConfig(FlowConfig 
flowConfig, boolean triggerL
     Map<String, AddSpecResponse> responseMap = new HashMap<>();
     try {
       responseMap = this.flowCatalog.put(flowSpec, triggerListener);
-    } catch (Throwable e) {
-      // TODO: Compilation errors should fall under throwable exceptions as 
well instead of checking for strings
-      if (e instanceof QuotaExceededException) {
+    } catch (QuotaExceededException e) {
         throw new RestLiServiceException(HttpStatus.S_503_SERVICE_UNAVAILABLE, 
e.getMessage());
-      }
+      } catch (Throwable e) {

Review Comment:
   again



##########
gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java:
##########
@@ -136,10 +136,10 @@ public CreateResponse createFlowConfig(FlowConfig 
flowConfig, boolean triggerLis
     } else {
       try {
         this.flowCatalog.put(flowSpec, triggerListener);
+      } catch (QuotaExceededException e) {
+        throw new RestLiServiceException(HttpStatus.S_503_SERVICE_UNAVAILABLE, 
e.getMessage());
       } catch (Throwable e) {
-        if (e instanceof QuotaExceededException) {
-          throw new 
RestLiServiceException(HttpStatus.S_503_SERVICE_UNAVAILABLE, e.getMessage());
-        }
+        // TODO: Compilation errors should fall under throwable exceptions as 
well instead of checking for strings

Review Comment:
   I realize this is just a request handler, so not hugely consequential to 
catch *all exceptions*, but please at least just log whatever you find here, so 
it's not a silent/squelched failure we have a hard time determining to be 
happening one future day.



##########
gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java:
##########
@@ -177,10 +177,10 @@ public UpdateResponse updateFlowConfig(FlowId flowId, 
FlowConfig flowConfig, boo
     }
     try {
       this.flowCatalog.put(createFlowSpecForConfig(flowConfig), 
triggerListener);
+    } catch (QuotaExceededException e) {
+      throw new RestLiServiceException(HttpStatus.S_503_SERVICE_UNAVAILABLE, 
e.getMessage());
     } catch (Throwable e) {
-      if (e instanceof QuotaExceededException) {
-        throw new RestLiServiceException(HttpStatus.S_503_SERVICE_UNAVAILABLE, 
e.getMessage());
-      }
+      // TODO: Compilation errors should fall under throwable exceptions as 
well instead of checking for strings

Review Comment:
   same here





Issue Time Tracking
-------------------

    Worklog Id:     (was: 793062)
    Time Spent: 5h 10m  (was: 5h)

> Return different Http Status on GaaS if Quota is Exceeded
> ---------------------------------------------------------
>
>                 Key: GOBBLIN-1656
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1656
>             Project: Apache Gobblin
>          Issue Type: New Feature
>          Components: gobblin-service
>            Reporter: William Lo
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 5h 10m
>  Remaining Estimate: 0h
>
> GaaS has quota limits for proxy users and flowGroups.
> When a user wants to create a flow that exceeds their specified quota, the 
> flow should
> 1) Not be run
> 2) Return a http status code (i.e. 503) due to exceeding the resource. This 
> allows clients to implement some wait and retry functionality



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to