diff --git a/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/TooSoonToRerunSameFlowException.java b/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/TooSoonToRerunSameFlowException.java index 2c28de9a4d..f718ec4a98 100644 --- a/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/TooSoonToRerunSameFlowException.java +++ b/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/TooSoonToRerunSameFlowException.java @@ -21,7 +21,8 @@ /** - * An {@link RuntimeException} thrown when lease cannot be acquired on provided entity. + * An exception thrown when another {@link FlowSpec} with same flow name and flow group + * is submitted within lease consolidation time. */ public class TooSoonToRerunSameFlowException extends RuntimeException { @Getter diff --git a/gobblin-service/src/test/java/org/apache/gobblin/service/modules/orchestration/OrchestratorTest.java b/gobblin-service/src/test/java/org/apache/gobblin/service/modules/orchestration/OrchestratorTest.java index 2a8d4f35a1..acfa6c51ca 100644 --- a/gobblin-service/src/test/java/org/apache/gobblin/service/modules/orchestration/OrchestratorTest.java +++ b/gobblin-service/src/test/java/org/apache/gobblin/service/modules/orchestration/OrchestratorTest.java @@ -26,6 +26,7 @@ import org.apache.commons.io.FileUtils; import org.apache.gobblin.config.ConfigBuilder; +import org.apache.gobblin.runtime.api.TooSoonToRerunSameFlowException; import org.apache.gobblin.runtime.spec_catalog.AddSpecResponse; import org.apache.gobblin.service.modules.flow.FlowUtils; import org.apache.gobblin.service.modules.flow.SpecCompiler; @@ -324,9 +325,9 @@ public void createFlowSpec() throws Throwable { /* If another flow has already acquired lease for this flowspec details within lease consolidation time, then we do not execute this flow, hence do not process and store the spec - and throw RuntimeException + and throw TooSoonToRerunSameFlowException */ - @Test(expectedExceptions = RuntimeException.class) + @Test(expectedExceptions = TooSoonToRerunSameFlowException.class) public void onAddSpecForAdhocFlowWhenSimilarExistingFlowIsCurrentlyLaunching() throws IOException { ConfigBuilder configBuilder = ConfigBuilder.create() .addPrimitive(ConfigurationKeys.FLOW_GROUP_KEY, "testGroup")