Izeren commented on code in PR #27719:
URL: https://github.com/apache/flink/pull/27719#discussion_r2877269031
##########
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionGraphRestartTest.java:
##########
@@ -349,43 +382,49 @@ void testFailExecutionAfterCancel() throws Exception {
new DefaultSchedulerBuilder(
createJobGraphToCancel(),
mainThreadExecutor,
- EXECUTOR_RESOURCE.getExecutor())
+ EXECUTOR_EXTENSION.getExecutor())
.setExecutionSlotAllocatorFactory(
createExecutionSlotAllocatorFactory(slotPool))
.setRestartBackoffTimeStrategy(
new TestRestartBackoffTimeStrategy(false,
Long.MAX_VALUE))
.setDelayExecutor(taskRestartExecutor)
.build();
- ExecutionGraph eg = scheduler.getExecutionGraph();
+ mainThreadExecutor.execute(
+ () -> {
+ ExecutionGraph eg = scheduler.getExecutionGraph();
- startScheduling(scheduler);
+ startScheduling(scheduler);
- offerSlots(slotPool, 1);
+ offerSlots(slotPool, 1);
- // Fail right after cancel (for example with concurrent slot
release)
- scheduler.cancel();
+ // Fail right after cancel (for example with
concurrent slot release)
+ scheduler.cancel();
- for (ExecutionVertex v : eg.getAllExecutionVertices()) {
- v.getCurrentExecutionAttempt().fail(new Exception("Test
Exception"));
- }
+ for (ExecutionVertex v : eg.getAllExecutionVertices())
{
+ v.getCurrentExecutionAttempt().fail(new
Exception("Test Exception"));
+ }
- FlinkAssertions.assertThatFuture(eg.getTerminationFuture())
- .eventuallySucceeds()
- .isEqualTo(JobStatus.CANCELED);
+
FlinkAssertions.assertThatFuture(eg.getTerminationFuture())
+ .eventuallySucceeds()
+ .isEqualTo(JobStatus.CANCELED);
Review Comment:
IIUC, scheduler does enforce confinement for the calls like
`startScheduling` based on `mainThreadExecutor` provided in constructor. Could
you please give an example of your suggested change?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]