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

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

                Author: ASF GitHub Bot
            Created on: 07/May/20 21:48
            Start Date: 07/May/20 21:48
    Worklog Time Spent: 10m 
      Work Description: sv2000 commented on a change in pull request #2981:
URL: https://github.com/apache/incubator-gobblin/pull/2981#discussion_r421813658



##########
File path: 
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_catalog/FlowCatalog.java
##########
@@ -325,12 +325,14 @@ public Spec getSpecWrapper(URI uri) {
     return responseMap;
   }
 
-  private boolean isCompileSuccessful(Map<String, AddSpecResponse> 
responseMap) {
+  public static boolean isCompileSuccessful(Map<String, AddSpecResponse> 
responseMap) {
     AddSpecResponse<String> addSpecResponse = 
responseMap.getOrDefault(ServiceConfigKeys.GOBBLIN_SERVICE_JOB_SCHEDULER_LISTENER_CLASS,
 new AddSpecResponse<>(""));
 
-    return addSpecResponse != null
-        && addSpecResponse.getValue() != null
-        && !addSpecResponse.getValue().contains("ConfigException");
+    return isCompileSuccessful(addSpecResponse.getValue());
+  }
+
+  public static boolean isCompileSuccessful(String dag) {

Review comment:
       Can we move this method into BaseFlowCompiler class and expose the 
method via compiler interface? It seems like a property of the compiler. 
Definitely, not that of FlowCatalog.

##########
File path: 
gobblin-service/src/main/java/org/apache/gobblin/service/modules/scheduler/GobblinServiceJobScheduler.java
##########
@@ -293,19 +294,27 @@ public AddSpecResponse onAddSpec(Spec addedSpec) {
           response = 
Arrays.toString(flowSpec.getCompilationErrors().toArray());
         }
 
-        if (!isExplain) {
+        boolean compileSuccess = FlowCatalog.isCompileSuccessful(response);
+
+        if (!isExplain && compileSuccess) {
           this.scheduledFlowSpecs.put(addedSpec.getUri().toString(), 
addedSpec);
 
           if (jobConfig.containsKey(ConfigurationKeys.JOB_SCHEDULE_KEY)) {
             _log.info("{} Scheduling flow spec: {} ", this.serviceName, 
addedSpec);
             scheduleJob(jobConfig, null);
             if (PropertiesUtils.getPropAsBoolean(jobConfig, 
ConfigurationKeys.FLOW_RUN_IMMEDIATELY, "false")) {
               _log.info("RunImmediately requested, hence executing FlowSpec: " 
+ addedSpec);
-              this.jobExecutor.execute(new 
NonScheduledJobRunner(flowSpec.getUri(), false, jobConfig, null));
+              this.jobExecutor.execute(new NonScheduledJobRunner(flowSpecUri, 
false, jobConfig, null));
             }
           } else {
             _log.info("No FlowSpec schedule found, so running FlowSpec: " + 
addedSpec);
-            this.jobExecutor.execute(new 
NonScheduledJobRunner(flowSpec.getUri(), true, jobConfig, null));
+            this.jobExecutor.execute(new NonScheduledJobRunner(flowSpecUri, 
true, jobConfig, null));
+          }
+        } else {
+          _log.info("Removing the flow spec: {}, since it is an EXPLAIN 
request or the flow compilation failed.", addedSpec);

Review comment:
       Any chance we can distinguish the log message based on whether it is an 
explain query of compile failed? Will help debugging.




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


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

    Worklog Id:     (was: 431907)
    Time Spent: 50m  (was: 40m)

> move spec store delete to gobblinservice job scheduler
> ------------------------------------------------------
>
>                 Key: GOBBLIN-1144
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1144
>             Project: Apache Gobblin
>          Issue Type: Bug
>            Reporter: Arjun Singh Bora
>            Priority: Major
>          Time Spent: 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to