[ https://issues.apache.org/jira/browse/GOBBLIN-744?focusedWorklogId=231059&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-231059 ]
ASF GitHub Bot logged work on GOBBLIN-744: ------------------------------------------ Author: ASF GitHub Bot Created on: 23/Apr/19 05:14 Start Date: 23/Apr/19 05:14 Worklog Time Spent: 10m Work Description: sv2000 commented on pull request #2609: GOBBLIN-744: Support cancellation of a Helix workflow via a DELETE Spec. URL: https://github.com/apache/incubator-gobblin/pull/2609#discussion_r277520100 ########## File path: gobblin-cluster/src/test/java/org/apache/gobblin/cluster/ClusterIntegrationTest.java ########## @@ -82,6 +99,95 @@ public void testJobShouldComplete() suite.waitForAndVerifyOutputFiles(); } + /** + * An integration test for cancelling a Helix workflow via a JobSpec. This test case starts a Helix cluster with + * a {@link FsScheduledJobConfigurationManager}. The test case does the following: + * <ul> + * <li> add a {@link org.apache.gobblin.runtime.api.JobSpec} that uses a {@link org.apache.gobblin.cluster.SleepingCustomTaskSource}) + * to {@link IntegrationJobCancelViaSpecSuite#FS_SPEC_CONSUMER_DIR}. which is picked by the JobConfigurationManager. </li> + * <li> the JobConfigurationManager sends a notification to the GobblinHelixJobScheduler which schedules the job for execution. The JobSpec is + * also added to the JobCatalog for persistence. Helix starts a Workflow for this JobSpec. </li> + * <li> We then add a {@link org.apache.gobblin.runtime.api.JobSpec} with DELETE Verb to {@link IntegrationJobCancelViaSpecSuite#FS_SPEC_CONSUMER_DIR}. + * This signals GobblinHelixJobScheduler (and, Helix) to delete the running job (i.e., Helix Workflow) started in the previous step. </li> + * <li> Finally, we inspect the state of the zNode corresponding to the Workflow resource in Zookeeper to ensure that its {@link org.apache.helix.task.TargetState} + * is STOP. </li> + * </ul> + */ + @Test (dependsOnMethods = { "testJobShouldGetCancelled" }) + public void testJobCancellationViaSpec() throws Exception { + this.suite = new IntegrationJobCancelViaSpecSuite(); + HelixManager helixManager = getHelixManager(); + + IntegrationJobCancelViaSpecSuite cancelViaSpecSuite = (IntegrationJobCancelViaSpecSuite) this.suite; + + //Add a new JobSpec to the path monitored by the SpecConsumer + cancelViaSpecSuite.addJobSpec(IntegrationJobCancelViaSpecSuite.JOB_ID, SpecExecutor.Verb.ADD.name()); + + //Start the cluster + cancelViaSpecSuite.startCluster(); + + helixManager.connect(); + + while (TaskDriver.getWorkflowContext(helixManager, IntegrationJobCancelViaSpecSuite.JOB_ID) == null) { Review comment: Done. ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 231059) Time Spent: 5h (was: 4h 50m) > Support cancellation of a Helix workflow via a DELETE Spec > ---------------------------------------------------------- > > Key: GOBBLIN-744 > URL: https://issues.apache.org/jira/browse/GOBBLIN-744 > Project: Apache Gobblin > Issue Type: Improvement > Components: gobblin-cluster > Affects Versions: 0.15.0 > Reporter: Sudarshan Vasudevan > Assignee: Hung Tran > Priority: Major > Fix For: 0.15.0 > > Time Spent: 5h > Remaining Estimate: 0h > > This task supports the ability to interrupt and cancel a running job on a > Gobblin Helix cluster via a DELETE Spec submitted to the > JobConfigurationManager. The DELETE Spec should have > "gobblin.cluster.shouldCancelRunningJobOnDelete" set to true for cancelling a > running job. The default behavior is to simply delete the corresponding > JobSpec from the JobCatalog. > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)