You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/02/09 14:11:32 UTC

[GitHub] [flink] rmetzger opened a new pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

rmetzger opened a new pull request #14910:
URL: https://github.com/apache/flink/pull/14910


   This PR is based on https://github.com/apache/flink/pull/14879
   
   ## What is the purpose of the change
   
   [Declarative Scheduler](https://cwiki.apache.org/confluence/display/FLINK/FLIP-160%3A+Declarative+Scheduler) consists of a number of internal states. 
   
   Note that this change is currently not usable as-is, as the other parts of declarative scheduler are not merged yet (See for the prototype this PR is based on: https://github.com/tillrohrmann/flink/tree/declarative-scheduler) 
   
   
   ## Verifying this change
   
   - The change is adding unit tests.
   - Note that integration tests for the declarative scheduler will cover additional functionality.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (**yes** / no / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
   Will be handled in a separate PR.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
rmetzger commented on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-777562133


   I addressed all your comments 
   (note: "the address feedback" commit contains 98% of my changes. I messed up an interactive rebase, the "add tests" commit contains a move of the MockExecutionEnvironment out of the CancellingTest to a top level class).


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
rmetzger commented on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-779248893


   Thanks for your review. I addressed your comments!


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775986669


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161",
       "triggerID" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b4ba3c37230a6f471b340a9426a270c29f812fec Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775986669


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161",
       "triggerID" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13217",
       "triggerID" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7130748c1cabb0a2e7fc436070da0c1d1c8450a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13248",
       "triggerID" : "e7130748c1cabb0a2e7fc436070da0c1d1c8450a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "723dc6290b3c32381684f2dd9052baf927bb47fd",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13341",
       "triggerID" : "723dc6290b3c32381684f2dd9052baf927bb47fd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e7130748c1cabb0a2e7fc436070da0c1d1c8450a Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13248) 
   * 723dc6290b3c32381684f2dd9052baf927bb47fd Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13341) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] tillrohrmann commented on a change in pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on a change in pull request #14910:
URL: https://github.com/apache/flink/pull/14910#discussion_r573738229



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/declarative/FailingTest.java
##########
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.scheduler.declarative;
+
+import org.apache.flink.api.common.JobStatus;
+import org.apache.flink.runtime.JobException;
+import org.apache.flink.runtime.client.JobExecutionException;
+import org.apache.flink.runtime.executiongraph.ExecutionGraph;
+import org.apache.flink.runtime.executiongraph.TestingExecutionGraphBuilder;
+import org.apache.flink.runtime.scheduler.ExecutionGraphHandler;
+import org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler;
+import org.apache.flink.util.TestLogger;
+
+import org.junit.Test;
+
+import java.util.function.Consumer;
+
+import static org.apache.flink.runtime.scheduler.declarative.WaitingForResourcesTest.assertNonNull;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+/** Tests for the {@link Failing} state of the declarative scheduler. */
+public class FailingTest extends TestLogger {
+    private final Throwable testFailureCause = new RuntimeException();
+
+    @Test
+    public void testFailJobOnEnter() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            Failing failing = createFailingState(ctx);
+            ctx.setExpectFinished(
+                    archivedExecutionGraph ->
+                            assertThat(archivedExecutionGraph.getState(), is(JobStatus.FAILED)));
+
+            failing.onEnter();
+        }
+    }
+
+    @Test
+    public void testIgnoreGlobalFailure() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            Failing failing = createFailingState(ctx);

Review comment:
       I guess `onEnter()` is missing here. By not sticking to the contract, we are testing scenarios which should not happen in "production".

##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/declarative/StateWithExecutionGraph.java
##########
@@ -138,7 +138,9 @@ public JobStatus getJobStatus() {
     @Override
     public void suspend(Throwable cause) {
         executionGraph.suspend(cause);
-        Preconditions.checkState(executionGraph.getState() == JobStatus.SUSPENDED);
+        Preconditions.checkState(
+                executionGraph.getState() == JobStatus.SUSPENDED
+                        || executionGraph.getState().isTerminalState());

Review comment:
       Why is this change necessary?

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/declarative/FailingTest.java
##########
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.scheduler.declarative;
+
+import org.apache.flink.api.common.JobStatus;
+import org.apache.flink.runtime.JobException;
+import org.apache.flink.runtime.client.JobExecutionException;
+import org.apache.flink.runtime.executiongraph.ExecutionGraph;
+import org.apache.flink.runtime.executiongraph.TestingExecutionGraphBuilder;
+import org.apache.flink.runtime.scheduler.ExecutionGraphHandler;
+import org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler;
+import org.apache.flink.util.TestLogger;
+
+import org.junit.Test;
+
+import java.util.function.Consumer;
+
+import static org.apache.flink.runtime.scheduler.declarative.WaitingForResourcesTest.assertNonNull;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+/** Tests for the {@link Failing} state of the declarative scheduler. */
+public class FailingTest extends TestLogger {
+    private final Throwable testFailureCause = new RuntimeException();
+
+    @Test
+    public void testFailJobOnEnter() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            Failing failing = createFailingState(ctx);
+            ctx.setExpectFinished(
+                    archivedExecutionGraph ->
+                            assertThat(archivedExecutionGraph.getState(), is(JobStatus.FAILED)));
+
+            failing.onEnter();
+        }
+    }
+
+    @Test
+    public void testIgnoreGlobalFailure() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            Failing failing = createFailingState(ctx);
+            failing.handleGlobalFailure(new RuntimeException());
+            ctx.assertNoStateTransition();
+        }
+    }
+
+    @Test
+    public void testTransitionToCancelOnCancel() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            Failing failing = createFailingState(ctx);

Review comment:
       `onEnter()` is missing

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/declarative/FailingTest.java
##########
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.scheduler.declarative;
+
+import org.apache.flink.api.common.JobStatus;
+import org.apache.flink.runtime.JobException;
+import org.apache.flink.runtime.client.JobExecutionException;
+import org.apache.flink.runtime.executiongraph.ExecutionGraph;
+import org.apache.flink.runtime.executiongraph.TestingExecutionGraphBuilder;
+import org.apache.flink.runtime.scheduler.ExecutionGraphHandler;
+import org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler;
+import org.apache.flink.util.TestLogger;
+
+import org.junit.Test;
+
+import java.util.function.Consumer;
+
+import static org.apache.flink.runtime.scheduler.declarative.WaitingForResourcesTest.assertNonNull;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+/** Tests for the {@link Failing} state of the declarative scheduler. */
+public class FailingTest extends TestLogger {
+    private final Throwable testFailureCause = new RuntimeException();
+
+    @Test
+    public void testFailJobOnEnter() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            Failing failing = createFailingState(ctx);
+            ctx.setExpectFinished(
+                    archivedExecutionGraph ->
+                            assertThat(archivedExecutionGraph.getState(), is(JobStatus.FAILED)));
+
+            failing.onEnter();
+        }
+    }
+
+    @Test
+    public void testIgnoreGlobalFailure() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            Failing failing = createFailingState(ctx);
+            failing.handleGlobalFailure(new RuntimeException());
+            ctx.assertNoStateTransition();
+        }
+    }
+
+    @Test
+    public void testTransitionToCancelOnCancel() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            Failing failing = createFailingState(ctx);
+            ctx.setExpectCanceling(assertNonNull());
+            failing.cancel();
+        }
+    }
+
+    @Test
+    public void testTransitionToFinishedOnSuspend() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            Failing failing = createFailingState(ctx);
+            ctx.setExpectFinished(
+                    archivedExecutionGraph ->
+                            assertThat(archivedExecutionGraph.getState(), is(JobStatus.FAILED)));

Review comment:
       The final `JobStatus` should be `SUSPENDED`.

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/declarative/FailingTest.java
##########
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.scheduler.declarative;
+
+import org.apache.flink.api.common.JobStatus;
+import org.apache.flink.runtime.JobException;
+import org.apache.flink.runtime.client.JobExecutionException;
+import org.apache.flink.runtime.executiongraph.ExecutionGraph;
+import org.apache.flink.runtime.executiongraph.TestingExecutionGraphBuilder;
+import org.apache.flink.runtime.scheduler.ExecutionGraphHandler;
+import org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler;
+import org.apache.flink.util.TestLogger;
+
+import org.junit.Test;
+
+import java.util.function.Consumer;
+
+import static org.apache.flink.runtime.scheduler.declarative.WaitingForResourcesTest.assertNonNull;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+/** Tests for the {@link Failing} state of the declarative scheduler. */
+public class FailingTest extends TestLogger {
+    private final Throwable testFailureCause = new RuntimeException();
+
+    @Test
+    public void testFailJobOnEnter() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            Failing failing = createFailingState(ctx);

Review comment:
       I guess that this creates an `ExecutionGraph` which directly goes to `FAILED` when calling `ExecutionGraph.fail` because there are no deployed/running `Executions`. I think this is a good example what a proper testing abstraction of the `ExecutionGraph` could help us with. We would no longer bind the logic of the tests to the underlying `ExecutionGraph` implementation.

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/declarative/FailingTest.java
##########
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.scheduler.declarative;
+
+import org.apache.flink.api.common.JobStatus;
+import org.apache.flink.runtime.JobException;
+import org.apache.flink.runtime.client.JobExecutionException;
+import org.apache.flink.runtime.executiongraph.ExecutionGraph;
+import org.apache.flink.runtime.executiongraph.TestingExecutionGraphBuilder;
+import org.apache.flink.runtime.scheduler.ExecutionGraphHandler;
+import org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler;
+import org.apache.flink.util.TestLogger;
+
+import org.junit.Test;
+
+import java.util.function.Consumer;
+
+import static org.apache.flink.runtime.scheduler.declarative.WaitingForResourcesTest.assertNonNull;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+/** Tests for the {@link Failing} state of the declarative scheduler. */
+public class FailingTest extends TestLogger {
+    private final Throwable testFailureCause = new RuntimeException();
+
+    @Test
+    public void testFailJobOnEnter() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            Failing failing = createFailingState(ctx);
+            ctx.setExpectFinished(
+                    archivedExecutionGraph ->
+                            assertThat(archivedExecutionGraph.getState(), is(JobStatus.FAILED)));
+
+            failing.onEnter();
+        }
+    }
+
+    @Test
+    public void testIgnoreGlobalFailure() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            Failing failing = createFailingState(ctx);
+            failing.handleGlobalFailure(new RuntimeException());
+            ctx.assertNoStateTransition();
+        }
+    }
+
+    @Test
+    public void testTransitionToCancelOnCancel() throws Exception {

Review comment:
       `testTransitionToCancelingOnCancel`




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775968981


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 723dc6290b3c32381684f2dd9052baf927bb47fd (Fri Feb 19 07:33:26 UTC 2021)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775986669


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161",
       "triggerID" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13217",
       "triggerID" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7130748c1cabb0a2e7fc436070da0c1d1c8450a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13248",
       "triggerID" : "e7130748c1cabb0a2e7fc436070da0c1d1c8450a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "723dc6290b3c32381684f2dd9052baf927bb47fd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "723dc6290b3c32381684f2dd9052baf927bb47fd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e7130748c1cabb0a2e7fc436070da0c1d1c8450a Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13248) 
   * 723dc6290b3c32381684f2dd9052baf927bb47fd UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] tillrohrmann commented on a change in pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on a change in pull request #14910:
URL: https://github.com/apache/flink/pull/14910#discussion_r576174781



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/declarative/FailingTest.java
##########
@@ -0,0 +1,178 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.scheduler.declarative;
+
+import org.apache.flink.api.common.JobStatus;
+import org.apache.flink.runtime.execution.ExecutionState;
+import org.apache.flink.runtime.executiongraph.ExecutionGraph;
+import org.apache.flink.runtime.executiongraph.TaskExecutionStateTransition;
+import org.apache.flink.runtime.scheduler.ExecutionGraphHandler;
+import org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler;
+import org.apache.flink.runtime.taskmanager.TaskExecutionState;
+import org.apache.flink.util.TestLogger;
+
+import org.junit.Test;
+
+import java.util.function.Consumer;
+
+import static org.apache.flink.runtime.scheduler.declarative.WaitingForResourcesTest.assertNonNull;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+/** Tests for the {@link Failing} state of the declarative scheduler. */
+public class FailingTest extends TestLogger {
+
+    private final Throwable testFailureCause = new RuntimeException();
+
+    @Test
+    public void testFailingStateOnEnter() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            failing.onEnter();
+            assertThat(meg.isFailing(), is(true));
+            ctx.assertNoStateTransition();
+        }
+    }
+
+    @Test
+    public void testTransitionToFailedWhenFailingCompletes() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            failing.onEnter(); // transition from RUNNING to FAILING
+            assertThat(meg.isFailing(), is(true));
+            ctx.setExpectFinished(
+                    archivedExecutionGraph ->
+                            assertThat(archivedExecutionGraph.getState(), is(JobStatus.FAILED)));
+            meg.completeCancellation(); // transition to FAILED
+        }
+    }
+
+    @Test
+    public void testTransitionToCancelingOnCancel() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            ctx.setExpectCanceling(assertNonNull());
+            failing.onEnter();
+            failing.cancel();
+        }
+    }
+
+    @Test
+    public void testTransitionToFinishedOnSuspend() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            ctx.setExpectFinished(
+                    archivedExecutionGraph ->
+                            assertThat(archivedExecutionGraph.getState(), is(JobStatus.SUSPENDED)));
+
+            failing.onEnter();
+            failing.suspend(new RuntimeException("suspend"));
+        }
+    }
+
+    @Test
+    public void testIgnoreGlobalFailure() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            failing.onEnter();
+            failing.handleGlobalFailure(new RuntimeException());
+            ctx.assertNoStateTransition();
+        }
+    }
+
+    @Test
+    public void testTaskFailuresAreIgnored() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            failing.onEnter();
+            // register execution at EG
+            ExecutingTest.MockExecutionJobVertex ejv =
+                    new ExecutingTest.MockExecutionJobVertex(failing.getExecutionGraph());
+            TaskExecutionStateTransition update =
+                    new TaskExecutionStateTransition(
+                            new TaskExecutionState(
+                                    failing.getJob().getJobID(),
+                                    ejv.getMockExecutionVertex()
+                                            .getCurrentExecutionAttempt()
+                                            .getAttemptId(),
+                                    ExecutionState.FAILED,
+                                    new RuntimeException()));
+            failing.updateTaskExecutionState(update);
+            ctx.assertNoStateTransition();
+            assertThat(meg.isFailGlobalCalled(), is(true));

Review comment:
       Why are we calling fail global if we receive a task failure?

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/declarative/FailingTest.java
##########
@@ -0,0 +1,178 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.scheduler.declarative;
+
+import org.apache.flink.api.common.JobStatus;
+import org.apache.flink.runtime.execution.ExecutionState;
+import org.apache.flink.runtime.executiongraph.ExecutionGraph;
+import org.apache.flink.runtime.executiongraph.TaskExecutionStateTransition;
+import org.apache.flink.runtime.scheduler.ExecutionGraphHandler;
+import org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler;
+import org.apache.flink.runtime.taskmanager.TaskExecutionState;
+import org.apache.flink.util.TestLogger;
+
+import org.junit.Test;
+
+import java.util.function.Consumer;
+
+import static org.apache.flink.runtime.scheduler.declarative.WaitingForResourcesTest.assertNonNull;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+/** Tests for the {@link Failing} state of the declarative scheduler. */
+public class FailingTest extends TestLogger {
+
+    private final Throwable testFailureCause = new RuntimeException();
+
+    @Test
+    public void testFailingStateOnEnter() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            failing.onEnter();
+            assertThat(meg.isFailing(), is(true));
+            ctx.assertNoStateTransition();
+        }
+    }
+
+    @Test
+    public void testTransitionToFailedWhenFailingCompletes() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            failing.onEnter(); // transition from RUNNING to FAILING
+            assertThat(meg.isFailing(), is(true));
+            ctx.setExpectFinished(
+                    archivedExecutionGraph ->
+                            assertThat(archivedExecutionGraph.getState(), is(JobStatus.FAILED)));
+            meg.completeCancellation(); // transition to FAILED
+        }
+    }
+
+    @Test
+    public void testTransitionToCancelingOnCancel() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            ctx.setExpectCanceling(assertNonNull());
+            failing.onEnter();
+            failing.cancel();
+        }
+    }
+
+    @Test
+    public void testTransitionToFinishedOnSuspend() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            ctx.setExpectFinished(
+                    archivedExecutionGraph ->
+                            assertThat(archivedExecutionGraph.getState(), is(JobStatus.SUSPENDED)));
+
+            failing.onEnter();
+            failing.suspend(new RuntimeException("suspend"));
+        }
+    }
+
+    @Test
+    public void testIgnoreGlobalFailure() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            failing.onEnter();
+            failing.handleGlobalFailure(new RuntimeException());
+            ctx.assertNoStateTransition();
+        }
+    }
+
+    @Test
+    public void testTaskFailuresAreIgnored() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            failing.onEnter();
+            // register execution at EG
+            ExecutingTest.MockExecutionJobVertex ejv =
+                    new ExecutingTest.MockExecutionJobVertex(failing.getExecutionGraph());
+            TaskExecutionStateTransition update =
+                    new TaskExecutionStateTransition(
+                            new TaskExecutionState(
+                                    failing.getJob().getJobID(),
+                                    ejv.getMockExecutionVertex()
+                                            .getCurrentExecutionAttempt()
+                                            .getAttemptId(),
+                                    ExecutionState.FAILED,
+                                    new RuntimeException()));
+            failing.updateTaskExecutionState(update);
+            ctx.assertNoStateTransition();
+            assertThat(meg.isFailGlobalCalled(), is(true));

Review comment:
       I think we are doing this because `updateTaskExecutionState` fails with a `NPE`.

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/declarative/FailingTest.java
##########
@@ -0,0 +1,178 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.scheduler.declarative;
+
+import org.apache.flink.api.common.JobStatus;
+import org.apache.flink.runtime.execution.ExecutionState;
+import org.apache.flink.runtime.executiongraph.ExecutionGraph;
+import org.apache.flink.runtime.executiongraph.TaskExecutionStateTransition;
+import org.apache.flink.runtime.scheduler.ExecutionGraphHandler;
+import org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler;
+import org.apache.flink.runtime.taskmanager.TaskExecutionState;
+import org.apache.flink.util.TestLogger;
+
+import org.junit.Test;
+
+import java.util.function.Consumer;
+
+import static org.apache.flink.runtime.scheduler.declarative.WaitingForResourcesTest.assertNonNull;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+/** Tests for the {@link Failing} state of the declarative scheduler. */
+public class FailingTest extends TestLogger {
+
+    private final Throwable testFailureCause = new RuntimeException();
+
+    @Test
+    public void testFailingStateOnEnter() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            failing.onEnter();
+            assertThat(meg.isFailing(), is(true));
+            ctx.assertNoStateTransition();
+        }
+    }
+
+    @Test
+    public void testTransitionToFailedWhenFailingCompletes() throws Exception {
+        try (MockFailingContext ctx = new MockFailingContext()) {
+            MockExecutionGraph meg = new MockExecutionGraph();
+            Failing failing = createFailingState(ctx, meg);
+            failing.onEnter(); // transition from RUNNING to FAILING
+            assertThat(meg.isFailing(), is(true));

Review comment:
       This has already been tested in `testFailingStateOnEnter`




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775986669


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161",
       "triggerID" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13217",
       "triggerID" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7130748c1cabb0a2e7fc436070da0c1d1c8450a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "e7130748c1cabb0a2e7fc436070da0c1d1c8450a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e711078acde12b997d01ac2282840d3cd958d7bd Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13217) 
   * e7130748c1cabb0a2e7fc436070da0c1d1c8450a UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
rmetzger commented on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-779609292


   Thanks for the review! I'll merge this now.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775986669


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161",
       "triggerID" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13217",
       "triggerID" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7130748c1cabb0a2e7fc436070da0c1d1c8450a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13248",
       "triggerID" : "e7130748c1cabb0a2e7fc436070da0c1d1c8450a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "723dc6290b3c32381684f2dd9052baf927bb47fd",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13341",
       "triggerID" : "723dc6290b3c32381684f2dd9052baf927bb47fd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 723dc6290b3c32381684f2dd9052baf927bb47fd Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13341) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] rmetzger closed pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
rmetzger closed pull request #14910:
URL: https://github.com/apache/flink/pull/14910


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on a change in pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
rmetzger commented on a change in pull request #14910:
URL: https://github.com/apache/flink/pull/14910#discussion_r576570468



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/declarative/MockExecutionGraph.java
##########
@@ -69,15 +73,22 @@ public MockExecutionGraph() throws IOException {
                 1,
                 ExecutionGraph.class.getClassLoader(),
                 VoidBlobWriter.getInstance(),
-                PartitionReleaseStrategyFactoryLoader.loadPartitionReleaseStrategyFactory(
-                        new Configuration()),
+                getPartitionReleaseStrategyFactoryLoader(),
                 NettyShuffleMaster.INSTANCE,
                 NoOpJobMasterPartitionTracker.INSTANCE,
                 ScheduleMode.EAGER,
                 NoOpExecutionDeploymentListener.get(),
                 (execution, newState) -> {},
                 0L);
         this.setJsonPlan(""); // field must not be null for ArchivedExecutionGraph creation
+        this.attachJobGraph(Collections.emptyList()); // method must be called to initialize
+        // PartitionReleaseStrategy.
+    }
+
+    private static PartitionReleaseStrategy.Factory getPartitionReleaseStrategyFactoryLoader() {
+        Configuration conf = new Configuration();
+        conf.set(PARTITION_RELEASE_DURING_JOB_EXECUTION, false);
+        return PartitionReleaseStrategyFactoryLoader.loadPartitionReleaseStrategyFactory(conf);

Review comment:
       Yes, I agree. This is very fragile and annoying to maintain.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775986669


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161",
       "triggerID" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13217",
       "triggerID" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7130748c1cabb0a2e7fc436070da0c1d1c8450a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13248",
       "triggerID" : "e7130748c1cabb0a2e7fc436070da0c1d1c8450a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e7130748c1cabb0a2e7fc436070da0c1d1c8450a Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13248) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] tillrohrmann commented on a change in pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on a change in pull request #14910:
URL: https://github.com/apache/flink/pull/14910#discussion_r576312246



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/declarative/MockExecutionGraph.java
##########
@@ -69,15 +73,22 @@ public MockExecutionGraph() throws IOException {
                 1,
                 ExecutionGraph.class.getClassLoader(),
                 VoidBlobWriter.getInstance(),
-                PartitionReleaseStrategyFactoryLoader.loadPartitionReleaseStrategyFactory(
-                        new Configuration()),
+                getPartitionReleaseStrategyFactoryLoader(),
                 NettyShuffleMaster.INSTANCE,
                 NoOpJobMasterPartitionTracker.INSTANCE,
                 ScheduleMode.EAGER,
                 NoOpExecutionDeploymentListener.get(),
                 (execution, newState) -> {},
                 0L);
         this.setJsonPlan(""); // field must not be null for ArchivedExecutionGraph creation
+        this.attachJobGraph(Collections.emptyList()); // method must be called to initialize
+        // PartitionReleaseStrategy.
+    }
+
+    private static PartitionReleaseStrategy.Factory getPartitionReleaseStrategyFactoryLoader() {
+        Configuration conf = new Configuration();
+        conf.set(PARTITION_RELEASE_DURING_JOB_EXECUTION, false);
+        return PartitionReleaseStrategyFactoryLoader.loadPartitionReleaseStrategyFactory(conf);

Review comment:
       Hmm, I strongly suggest to add an interface for testing in the foreseeable future. I think we are seeing the consequences of mocking the `ExecutionGraph` by running into problems originating from setting it up wrongly.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775986669


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161",
       "triggerID" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13217",
       "triggerID" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e711078acde12b997d01ac2282840d3cd958d7bd Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13217) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775986669


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161",
       "triggerID" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b4ba3c37230a6f471b340a9426a270c29f812fec Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161) 
   * e711078acde12b997d01ac2282840d3cd958d7bd UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775986669


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161",
       "triggerID" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b4ba3c37230a6f471b340a9426a270c29f812fec Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
rmetzger commented on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-776936981


   Rebased to latest master, will address the comments tomorrow (ideally after the Canceling PR is merged, so that I can share the MockExecutionGraph).


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775986669


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161",
       "triggerID" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13217",
       "triggerID" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7130748c1cabb0a2e7fc436070da0c1d1c8450a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13248",
       "triggerID" : "e7130748c1cabb0a2e7fc436070da0c1d1c8450a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e711078acde12b997d01ac2282840d3cd958d7bd Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13217) 
   * e7130748c1cabb0a2e7fc436070da0c1d1c8450a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13248) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775968981


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit b4ba3c37230a6f471b340a9426a270c29f812fec (Tue Feb 09 14:13:43 UTC 2021)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775986669


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b4ba3c37230a6f471b340a9426a270c29f812fec UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14910: [FLINK-21259] Add Failing state for DeclarativeScheduler

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14910:
URL: https://github.com/apache/flink/pull/14910#issuecomment-775986669


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161",
       "triggerID" : "b4ba3c37230a6f471b340a9426a270c29f812fec",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13217",
       "triggerID" : "e711078acde12b997d01ac2282840d3cd958d7bd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b4ba3c37230a6f471b340a9426a270c29f812fec Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13161) 
   * e711078acde12b997d01ac2282840d3cd958d7bd Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13217) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org