vsantwana commented on code in PR #1238:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1238#discussion_r4426302966
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/AbstractFlinkService.java:
##########
@@ -853,13 +851,25 @@ private void populateStateSize(
var parameters =
checkpointingStatisticsHeaders.getUnresolvedMessageParameters();
parameters.jobPathParameter.resolve(JobID.fromHexString(jobId));
- CheckpointingStatistics checkpointingStatistics =
- clusterClient
- .sendRequest(
- checkpointingStatisticsHeaders,
- parameters,
- EmptyRequestBody.getInstance())
- .get();
+ CheckpointingStatistics checkpointingStatistics;
+ try {
+ checkpointingStatistics =
+ clusterClient
+ .sendRequest(
+ checkpointingStatisticsHeaders,
+ parameters,
+ EmptyRequestBody.getInstance())
+ .get(
+
operatorConfig.getFlinkClientTimeout().toSeconds(),
+ TimeUnit.SECONDS);
+ } catch (ExecutionException e) {
+ if (isCheckpointingDisabled(e)) {
+ LOG.debug(
+ "Checkpointing not enabled for job {},
skipping state size", jobId);
Review Comment:
Agreed, removed in b198fa9c. `getLastCheckpoint` keeps a DEBUG line, since
there it replaces the existing WARN with a stack trace.
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/AbstractFlinkService.java:
##########
@@ -853,13 +851,25 @@ private void populateStateSize(
var parameters =
checkpointingStatisticsHeaders.getUnresolvedMessageParameters();
parameters.jobPathParameter.resolve(JobID.fromHexString(jobId));
- CheckpointingStatistics checkpointingStatistics =
- clusterClient
- .sendRequest(
- checkpointingStatisticsHeaders,
- parameters,
- EmptyRequestBody.getInstance())
- .get();
+ CheckpointingStatistics checkpointingStatistics;
+ try {
+ checkpointingStatistics =
+ clusterClient
+ .sendRequest(
+ checkpointingStatisticsHeaders,
+ parameters,
+ EmptyRequestBody.getInstance())
+ .get(
+
operatorConfig.getFlinkClientTimeout().toSeconds(),
+ TimeUnit.SECONDS);
+ } catch (ExecutionException e) {
+ if (isCheckpointingDisabled(e)) {
+ LOG.debug(
+ "Checkpointing not enabled for job {},
skipping state size", jobId);
+ return;
+ }
+ throw e;
Review Comment:
Added in b198fa9c: a 500 from the checkpoint statistics request still fails
`getClusterInfo` with an `ExecutionException`.
##########
flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/service/AbstractFlinkServiceTest.java:
##########
@@ -1264,6 +1267,16 @@ public void getClusterInfoTest() throws Exception {
.put(AbstractFlinkService.FIELD_NAME_STATE_SIZE,
"42424242")
.build(),
flinkService.getClusterInfo(conf,
JobID.generate().toHexString()).getInfo());
+
+ // Jobs without checkpointing (e.g. batch jobs) have no checkpoint
statistics
+ checkpointingStatisticsResponse.set(
+ CompletableFuture.failedFuture(
+ new RestClientException(
+ "[Checkpointing has not been enabled.]",
Review Comment:
I kept the plain message, because that is what the JobManager sends in 1.20.
`CheckpointingStatisticsHandler` throws a `RestHandlerException`, and
`AbstractHandler` puts only its `getMessage()` into the error body. The
operator log from production shows the same `[Checkpointing has not been
enabled.]`. Which Flink version gave you the `RestHandlerException:` prefix?
--
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]