Skip to content

Commit 0981b82

Browse files
committed
Extract TooSoonToRerunSameFlowException from Throwable in Flow Catalog listeners
1 parent a782202 commit 0981b82

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_catalog/FlowCatalog.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.util.Properties;
3030

3131
import org.apache.commons.lang3.reflect.ConstructorUtils;
32+
import org.apache.gobblin.runtime.api.TooSoonToRerunSameFlowException;
3233
import org.slf4j.Logger;
3334
import org.slf4j.LoggerFactory;
3435

@@ -392,7 +393,12 @@ private Map<String, AddSpecResponse> updateOrAddSpecHelper(Spec spec, boolean tr
392393
// If flow fails compilation, the result will have a non-empty string with the error
393394
if (!response.getValue().getFailures().isEmpty()) {
394395
for (Map.Entry<SpecCatalogListener, CallbackResult<AddSpecResponse>> entry : response.getValue().getFailures().entrySet()) {
395-
throw entry.getValue().getError().getCause();
396+
Throwable error = entry.getValue().getError();
397+
if (error instanceof TooSoonToRerunSameFlowException) {
398+
throw (TooSoonToRerunSameFlowException) error;
399+
} else {
400+
throw error.getCause();
401+
}
396402
}
397403
}
398404
}

gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/MySqlDagManagementStateStore.java

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import org.apache.gobblin.runtime.api.SpecNotFoundException;
4242
import org.apache.gobblin.runtime.api.TopologySpec;
4343
import org.apache.gobblin.runtime.spec_catalog.FlowCatalog;
44-
import org.apache.gobblin.service.modules.flow.FlowUtils;
4544
import org.apache.gobblin.service.modules.flowgraph.Dag;
4645
import org.apache.gobblin.service.modules.flowgraph.DagNodeId;
4746
import org.apache.gobblin.service.modules.spec.JobExecutionPlan;

0 commit comments

Comments
 (0)