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 2020/11/03 18:46:07 UTC
[GitHub] [flink] kl0u opened a new pull request #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
kl0u opened a new pull request #13911:
URL: https://github.com/apache/flink/pull/13911
## What is the purpose of the change
Currently when executing an application in Attached Application mode
we do not shutdown the cluster when the job is cancelled. That is
because the exception thrown does not include the STATUS with which
the job failed, so we cannot distinguish between different reasons
of unsuccessful termination. This commit fixes this.
## Brief change log
The `EmbeddedJobClient.getJobExecutionResult()` now throws the same exception as the execution in detached mode. This includes the usual exception thrown by the `jobResult.toJobExecutionResult(classLoader)` wrapped into an `UnsuccessfulTerminationException` which also includes the `ApplicationStatus`.
## Verifying this change
Test was added in the `ApplicationDispatcherBootstrapTest`.
## 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
- Does this pull request introduce a new feature? (yes / **no**)
- If yes, how is the feature documented? (**not applicable** / docs / JavaDocs / not documented)
----------------------------------------------------------------
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] kl0u closed pull request #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
kl0u closed pull request #13911:
URL: https://github.com/apache/flink/pull/13911
----------------------------------------------------------------
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 #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13911:
URL: https://github.com/apache/flink/pull/13911#issuecomment-721337379
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "27cb8e55ae9143a809e39b45efea37b3edffb7e0",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8921",
"triggerID" : "27cb8e55ae9143a809e39b45efea37b3edffb7e0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 27cb8e55ae9143a809e39b45efea37b3edffb7e0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8921)
<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] kl0u commented on a change in pull request #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
kl0u commented on a change in pull request #13911:
URL: https://github.com/apache/flink/pull/13911#discussion_r518602324
##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/EmbeddedJobClient.java
##########
@@ -126,7 +126,8 @@ public JobID getJobID() {
try {
return jobResult.toJobExecutionResult(classLoader);
} catch (Throwable t) {
- throw new CompletionException(new Exception("Job " + jobId + " failed", t));
+ throw new CompletionException(
+ UnsuccessfulTerminationException.fromJobResult(jobResult, classLoader));
Review comment:
For the first part, for now this is not the contract. Other implementations of the `JobClient` do not throw this exception and I did not like to change it in case people have exception handlers based on the current behaviour. Currently the `ClusterClientJobClientAdapter` wraps the exception from the `JobResult.toJobExecutionResult()` into a `ProgramInvocationException` and the `MiniClusterJobClient` simply wraps it in a `CompletionException`. So I would propose making this uniform and part of the contract in another issue.
That said, I believe that an exception with the job status like the `UnsuccessfulExecutionException` is a good candidate for the common behaviour.
For the second part, yes the `ApplicationMode` only works with an `EmbeddedJobClient`.
----------------------------------------------------------------
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 #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13911:
URL: https://github.com/apache/flink/pull/13911#issuecomment-721337379
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "27cb8e55ae9143a809e39b45efea37b3edffb7e0",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8921",
"triggerID" : "27cb8e55ae9143a809e39b45efea37b3edffb7e0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 27cb8e55ae9143a809e39b45efea37b3edffb7e0 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8921)
<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] kl0u commented on a change in pull request #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
kl0u commented on a change in pull request #13911:
URL: https://github.com/apache/flink/pull/13911#discussion_r518624102
##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/EmbeddedJobClient.java
##########
@@ -126,7 +126,8 @@ public JobID getJobID() {
try {
return jobResult.toJobExecutionResult(classLoader);
} catch (Throwable t) {
- throw new CompletionException(new Exception("Job " + jobId + " failed", t));
+ throw new CompletionException(
+ UnsuccessfulTerminationException.fromJobResult(jobResult, classLoader));
Review comment:
This is the issue https://issues.apache.org/jira/browse/FLINK-20020
----------------------------------------------------------------
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] kl0u commented on a change in pull request #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
kl0u commented on a change in pull request #13911:
URL: https://github.com/apache/flink/pull/13911#discussion_r518597867
##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/UnsuccessfulTerminationException.java
##########
@@ -32,11 +32,11 @@
* application with a given {@link ApplicationStatus}.
*/
@Internal
-public class ApplicationFailureException extends JobExecutionException {
+public class UnsuccessfulTerminationException extends JobExecutionException {
Review comment:
Yes, I can rename it to `UnsuccessfulExecutionException`. And yes, the cluster is going to be shutdown one way or another.
----------------------------------------------------------------
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 #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13911:
URL: https://github.com/apache/flink/pull/13911#issuecomment-721337379
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "27cb8e55ae9143a809e39b45efea37b3edffb7e0",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "27cb8e55ae9143a809e39b45efea37b3edffb7e0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 27cb8e55ae9143a809e39b45efea37b3edffb7e0 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 commented on pull request #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13911:
URL: https://github.com/apache/flink/pull/13911#issuecomment-721311402
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 27cb8e55ae9143a809e39b45efea37b3edffb7e0 (Tue Nov 03 18:48:17 UTC 2020)
**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] kl0u commented on a change in pull request #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
kl0u commented on a change in pull request #13911:
URL: https://github.com/apache/flink/pull/13911#discussion_r518597999
##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/EmbeddedJobClient.java
##########
@@ -126,7 +126,8 @@ public JobID getJobID() {
try {
return jobResult.toJobExecutionResult(classLoader);
} catch (Throwable t) {
- throw new CompletionException(new Exception("Job " + jobId + " failed", t));
+ throw new CompletionException(
+ ApplicationFailureException.fromJobResult(jobResult, classLoader));
Review comment:
Yes.
----------------------------------------------------------------
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] kl0u commented on pull request #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
kl0u commented on pull request #13911:
URL: https://github.com/apache/flink/pull/13911#issuecomment-721312495
@wangyang0918
----------------------------------------------------------------
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] kl0u commented on pull request #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
kl0u commented on pull request #13911:
URL: https://github.com/apache/flink/pull/13911#issuecomment-722956346
Thanks a lot for the reviews @wangyang0918 and @tillrohrmann . Merging this in both `master` and `1.11`.
----------------------------------------------------------------
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 #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on a change in pull request #13911:
URL: https://github.com/apache/flink/pull/13911#discussion_r518178460
##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/EmbeddedJobClient.java
##########
@@ -126,7 +126,8 @@ public JobID getJobID() {
try {
return jobResult.toJobExecutionResult(classLoader);
} catch (Throwable t) {
- throw new CompletionException(new Exception("Job " + jobId + " failed", t));
+ throw new CompletionException(
+ UnsuccessfulTerminationException.fromJobResult(jobResult, classLoader));
Review comment:
Should this become part of the `JobClient.getJobExecutionResult` contract? If yes, then it needs to be documented. Moreover, one could also think about adding a unit test for this behaviour.
Is it guaranteed that the `ApplicationDispatcherBootstrap` will only work with an `EmbeddedJobClient`?
##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/UnsuccessfulTerminationException.java
##########
@@ -32,11 +32,11 @@
* application with a given {@link ApplicationStatus}.
*/
@Internal
-public class ApplicationFailureException extends JobExecutionException {
+public class UnsuccessfulTerminationException extends JobExecutionException {
Review comment:
Isn't this exception more about an unsuccessful execution or completion than the termination? The termination of the cluster will happen as a result of this exception, right?
##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/EmbeddedJobClient.java
##########
@@ -126,7 +126,8 @@ public JobID getJobID() {
try {
return jobResult.toJobExecutionResult(classLoader);
} catch (Throwable t) {
- throw new CompletionException(new Exception("Job " + jobId + " failed", t));
+ throw new CompletionException(
+ ApplicationFailureException.fromJobResult(jobResult, classLoader));
Review comment:
Is this the actual change which fixes the 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] kl0u commented on a change in pull request #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.
Posted by GitBox <gi...@apache.org>.
kl0u commented on a change in pull request #13911:
URL: https://github.com/apache/flink/pull/13911#discussion_r518618742
##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/EmbeddedJobClient.java
##########
@@ -126,7 +126,8 @@ public JobID getJobID() {
try {
return jobResult.toJobExecutionResult(classLoader);
} catch (Throwable t) {
- throw new CompletionException(new Exception("Job " + jobId + " failed", t));
+ throw new CompletionException(
+ UnsuccessfulTerminationException.fromJobResult(jobResult, classLoader));
Review comment:
I can open a separate issue and discuss it there.
----------------------------------------------------------------
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