rkhachatryan commented on code in PR #22022:
URL: https://github.com/apache/flink/pull/22022#discussion_r1122982354
##########
flink-tests/src/test/java/org/apache/flink/runtime/operators/lifecycle/TestJobExecutor.java:
##########
@@ -164,22 +164,23 @@ private void waitForFailover(BlockingQueue<TestEvent>
queue) throws Exception {
}
private void handleFailoverTimeout(TimeoutException e) throws Exception {
+ JobStatus jobStatus =
miniClusterResource.getClusterClient().getJobStatus(jobID).get();
String message =
String.format(
"Unable to failover the job: %s; job status: %s",
- e.getMessage(),
-
miniClusterResource.getClusterClient().getJobStatus(jobID).get());
- Optional<SerializedThrowable> throwable =
- miniClusterResource
- .getClusterClient()
- .requestJobResult(jobID)
- .get()
- .getSerializedThrowable();
- if (throwable.isPresent()) {
- throw new RuntimeException(message, throwable.get());
- } else {
- throw new RuntimeException(message);
+ e.getMessage(), jobStatus);
+ if (jobStatus.isGloballyTerminalState()) {
+ Optional<SerializedThrowable> throwable =
Review Comment:
I think it's better to keep `isGloballyTerminalState` condition because it
might then report `JobCancellationException` if `jobStatus == CANCELED` or
something else for `UNKNOWN`, which might be useful.
(and as long as job is finished and the API returns `Optional`, no exception
shouldn't be a problem)
--
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]