GJL commented on a change in pull request #9860: [FLINK-14331][runtime] Reset
vertices right after they transition to terminated states
URL: https://github.com/apache/flink/pull/9860#discussion_r333526806
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/DefaultSchedulerTest.java
##########
@@ -254,6 +262,58 @@ public void failJobIfNotEnoughResources() throws
Exception {
"Could not allocate the required slot within
slot request timeout.").isPresent());
}
+ @Test
+ public void vertexIsResetBeforeRestarted() throws Exception {
+ final JobGraph jobGraph = singleNonParallelJobVertexJobGraph();
+
+ final TestSchedulingStrategy.Factory schedulingStrategyFactory
= new TestSchedulingStrategy.Factory();
+ final DefaultScheduler scheduler = createScheduler(jobGraph,
schedulingStrategyFactory);
+ final TestSchedulingStrategy schedulingStrategy =
schedulingStrategyFactory.getLastCreatedSchedulingStrategy();
+ final SchedulingTopology topology =
schedulingStrategy.getSchedulingTopology();
+
+ startScheduling(scheduler);
+
+ final SchedulingExecutionVertex vertex =
Iterables.getOnlyElement(topology.getVertices());
Review comment:
You didn't like this approach?
```
final ArchivedExecutionVertex onlyExecutionVertex =
Iterables.getOnlyElement(scheduler.requestJob().getAllExecutionVertices());
final ExecutionAttemptID attemptId =
onlyExecutionVertex.getCurrentExecutionAttempt().getAttemptId();
```
`requestJob()` is public API. In contrast, `getExecutionVertex()` is
supposed to be only used by subclasses of `SchedulerBase`.
----------------------------------------------------------------
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]
With regards,
Apache Git Services