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 2023/01/02 08:09:43 UTC
[GitHub] [flink] link3280 opened a new pull request, #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
link3280 opened a new pull request, #21581:
URL: https://github.com/apache/flink/pull/21581
**(The sections below can be removed for hotfixes of typos)**
-->
## What is the purpose of the change
Currently, the stop-job operation produces some verbose error msg and doesn't handle exceptions in stop-without-savepoint gracefully.
This PR fixes the problem.
## Brief change log
- Wrap simple cancel with try-catch.
- Wait for simple cancel Acknowledge before returning 'OK'.
- Simplify exception message for stop job operations.
## Verifying this change
Please make sure both new and modified tests in this PR follows the conventions defined in our code quality guide: https://flink.apache.org/contributing/code-style-and-quality-common.html#testing
This change is a trivial rework / code cleanup without any test coverage.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? 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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] fsk119 commented on a diff in pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by GitBox <gi...@apache.org>.
fsk119 commented on code in PR #21581:
URL: https://github.com/apache/flink/pull/21581#discussion_r1066602543
##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationExecutor.java:
##########
@@ -487,23 +487,22 @@ public ResultFetcher callStopJobOperation(
.get(
clientTimeout.toMillis(),
TimeUnit.MILLISECONDS));
- } catch (Exception e) {
- throw new FlinkException(
- "Could not stop job "
- + stopJobOperation.getJobId()
- + " in session "
- + handle.getIdentifier()
- + ".",
- e);
+ } else {
+ clusterClient.cancel(JobID.fromHexString(jobId)).get();
+ return Optional.empty();
}
- } else {
- clusterClient.cancel(JobID.fromHexString(jobId));
- return Optional.empty();
+ } catch (Exception e) {
+ throw new FlinkException(e);
Review Comment:
Can we directly throw SqlExecutionExcetpion here? We can also catch FlinkException in the `runClusterAction`.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] link3280 commented on a diff in pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by GitBox <gi...@apache.org>.
link3280 commented on code in PR #21581:
URL: https://github.com/apache/flink/pull/21581#discussion_r1066752130
##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationExecutor.java:
##########
@@ -487,23 +487,22 @@ public ResultFetcher callStopJobOperation(
.get(
clientTimeout.toMillis(),
TimeUnit.MILLISECONDS));
- } catch (Exception e) {
- throw new FlinkException(
- "Could not stop job "
- + stopJobOperation.getJobId()
- + " in session "
- + handle.getIdentifier()
- + ".",
- e);
+ } else {
+ clusterClient.cancel(JobID.fromHexString(jobId)).get();
+ return Optional.empty();
}
- } else {
- clusterClient.cancel(JobID.fromHexString(jobId));
- return Optional.empty();
+ } catch (Exception e) {
+ throw new FlinkException(e);
Review Comment:
Good point. Fixed in https://github.com/apache/flink/pull/21582 also. I would rebase it later if the other is merged and conflicts with this 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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] link3280 commented on a diff in pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by GitBox <gi...@apache.org>.
link3280 commented on code in PR #21581:
URL: https://github.com/apache/flink/pull/21581#discussion_r1066752130
##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationExecutor.java:
##########
@@ -487,23 +487,22 @@ public ResultFetcher callStopJobOperation(
.get(
clientTimeout.toMillis(),
TimeUnit.MILLISECONDS));
- } catch (Exception e) {
- throw new FlinkException(
- "Could not stop job "
- + stopJobOperation.getJobId()
- + " in session "
- + handle.getIdentifier()
- + ".",
- e);
+ } else {
+ clusterClient.cancel(JobID.fromHexString(jobId)).get();
+ return Optional.empty();
}
- } else {
- clusterClient.cancel(JobID.fromHexString(jobId));
- return Optional.empty();
+ } catch (Exception e) {
+ throw new FlinkException(e);
Review Comment:
Good point. Fixed in https://github.com/apache/flink/pull/21582.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] link3280 commented on pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by GitBox <gi...@apache.org>.
link3280 commented on PR #21581:
URL: https://github.com/apache/flink/pull/21581#issuecomment-1369443823
Please kindly take a look @fsk119
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] link3280 commented on pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by GitBox <gi...@apache.org>.
link3280 commented on PR #21581:
URL: https://github.com/apache/flink/pull/21581#issuecomment-1396377724
ping @fsk119 . It should be a quick one :)
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #21581:
URL: https://github.com/apache/flink/pull/21581#issuecomment-1368728156
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "1d36198dac7945f94c89b8a78fae44774216268f",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "1d36198dac7945f94c89b8a78fae44774216268f",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 1d36198dac7945f94c89b8a78fae44774216268f UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] link3280 commented on pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by GitBox <gi...@apache.org>.
link3280 commented on PR #21581:
URL: https://github.com/apache/flink/pull/21581#issuecomment-1379901076
CI ran into https://issues.apache.org/jira/browse/FLINK-30328. Re-run CI.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] link3280 commented on pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by GitBox <gi...@apache.org>.
link3280 commented on PR #21581:
URL: https://github.com/apache/flink/pull/21581#issuecomment-1379901326
@flinkbot run azure
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] link3280 commented on pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by GitBox <gi...@apache.org>.
link3280 commented on PR #21581:
URL: https://github.com/apache/flink/pull/21581#issuecomment-1369343457
@flinkbot run azure
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] link3280 commented on pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by GitBox <gi...@apache.org>.
link3280 commented on PR #21581:
URL: https://github.com/apache/flink/pull/21581#issuecomment-1380069596
@fsk119 CI turned green. Please kindly take a look at your convenience.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] fsk119 merged pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by "fsk119 (via GitHub)" <gi...@apache.org>.
fsk119 merged PR #21581:
URL: https://github.com/apache/flink/pull/21581
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] link3280 commented on pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by GitBox <gi...@apache.org>.
link3280 commented on PR #21581:
URL: https://github.com/apache/flink/pull/21581#issuecomment-1368790905
@flinkbot run azure
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] link3280 commented on pull request #21581: [FLINK-30538][SQL gateway/client] Improve error handling of stop job operation
Posted by "link3280 (via GitHub)" <gi...@apache.org>.
link3280 commented on PR #21581:
URL: https://github.com/apache/flink/pull/21581#issuecomment-1407542153
ping @fsk119
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org