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

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

                Author: ASF GitHub Bot
            Created on: 18/Nov/24 18:41
            Start Date: 18/Nov/24 18:41
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #4076:
URL: https://github.com/apache/gobblin/pull/4076#discussion_r1847077237


##########
gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/modules/restli/FlowConfigsV2ResourceHandler.java:
##########
@@ -256,7 +257,10 @@ public CreateKVResponse<ComplexResourceKey<FlowId, 
FlowStatusId>, FlowConfig> cr
       responseMap = this.flowCatalog.put(flowSpec, true);
     } catch (QuotaExceededException e) {
       throw new RestLiServiceException(HttpStatus.S_503_SERVICE_UNAVAILABLE, 
e.getMessage());
-    } catch (Throwable e) {
+    } catch(LeaseUnavailableException e){
+      throw new RestLiServiceException(HttpStatus.S_409_CONFLICT, 
e.getMessage());

Review Comment:
   usually exception messages are designed for logging, more than for end-user 
consumption, so probably not appropriate to blindly return that.  (it's 
sometimes done for a 5xx error, as above... but even that can be inadvisable.)
   
   anyway, the 409 above might offer a better template:
   ```
   return new CreateKVResponse<>(new 
RestLiServiceException(HttpStatus.S_409_CONFLICT,
       "FlowSpec with URI " + flowSpec.getUri() + " was launched less than N 
secs ago, no action will be taken"));
   ```
   (to provide N we may wish to tunnel the value of epsilon... or at least how 
many secs remain before a subsequent launch would be possible)
   
   also: when do we want to `return` (as that 409 above does), vs. `throw`?





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

    Worklog Id:     (was: 944163)
    Time Spent: 1h 20m  (was: 1h 10m)

> Adhoc flows are not being deleted from GaaS FlowSpec store
> ----------------------------------------------------------
>
>                 Key: GOBBLIN-2173
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-2173
>             Project: Apache Gobblin
>          Issue Type: Bug
>          Components: gobblin-service
>            Reporter: Abhishek Jain
>            Assignee: Abhishek Tiwari
>            Priority: Critical
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> In GaaS, we store adhoc flows temporarily in our flowspec DB in order to 
> persist them in service restart/failover scenarios. However, it is expected 
> that once these flows are kicked off/ forwarded to the DagProcEngine, they 
> need to be removed from our flowspec db.
> This is currently not consistently happening, there seems to be some edge 
> case(s) where they are persisted in the db. This can be fatal for users such 
> as DIL that run adhoc flows using the same flowgroup/flowname consistently, 
> which will lead to their flows being stuck. We need to find which edge cases 
> are not handling the flow spec deletion properly.



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

Reply via email to