Bogdan Chifor
10/09/2023, 7:16 PMsavepoints endpoint, I can even use the cancel: true payload field to actually stop the job with a savepoint, and that works just fine. It’s only when hitting the jobs/{job_id}/stop endpoint that I run into this issue. I’ll provide more details in the 🧵 , but I’m curious if anyone else ran into this issue before.Bogdan Chifor
10/09/2023, 7:17 PMPOST http://<JM_URL>/jobs/00000000000000000000000000000000/stop
Payload: {"drain":false,"targetDirectory":"s3p://...","formatType":"CANONICAL"}Bogdan Chifor
10/09/2023, 7:18 PMBogdan Chifor
10/09/2023, 7:18 PMorg.apache.flink.runtime.checkpoint.CheckpointException: Task has failed.
at org.apache.flink.runtime.messages.checkpoint.SerializedCheckpointException.unwrap(SerializedCheckpointException.java:51)
at org.apache.flink.runtime.checkpoint.CheckpointCoordinator.receiveDeclineMessage(CheckpointCoordinator.java:1013)
at org.apache.flink.runtime.scheduler.ExecutionGraphHandler.lambda$declineCheckpoint$2(ExecutionGraphHandler.java:103)
at org.apache.flink.runtime.scheduler.ExecutionGraphHandler.lambda$processCheckpointCoordinatorMessage$3(ExecutionGraphHandler.java:119)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.apache.flink.runtime.checkpoint.CheckpointException: Task name with subtask : Source: track-stream -> (kafka-bird-tracks-watermark, telemetry-parser) (5/18)#0 Failure reason: Task has failed.
at org.apache.flink.runtime.taskmanager.Task.declineCheckpoint(Task.java:1388)
at org.apache.flink.runtime.taskmanager.Task.lambda$triggerCheckpointBarrier$3(Task.java:1331)
at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
at org.apache.flink.streaming.runtime.tasks.SourceStreamTask$LegacySourceFunctionThread.run(SourceStreamTask.java:343)
Caused by: java.util.concurrent.CompletionException: org.apache.flink.streaming.connectors.kafka.internals.Handover$ClosedException
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(Unknown Source)
... 3 more
Caused by: org.apache.flink.streaming.connectors.kafka.internals.Handover$ClosedException
at org.apache.flink.streaming.connectors.kafka.internals.Handover.close(Handover.java:177)
at org.apache.flink.streaming.connectors.kafka.internals.KafkaFetcher.cancel(KafkaFetcher.java:164)
at org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumerBase.cancel(FlinkKafkaConsumerBase.java:945)
at org.apache.flink.streaming.api.operators.StreamSource.stop(StreamSource.java:128)
at org.apache.flink.streaming.runtime.tasks.SourceStreamTask.stopOperatorForStopWithSavepoint(SourceStreamTask.java:305)
at org.apache.flink.streaming.runtime.tasks.SourceStreamTask.lambda$triggerStopWithSavepointAsync$1(SourceStreamTask.java:285)
at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.runThrowing(StreamTaskActionExecutor.java:93)
at org.apache.flink.streaming.runtime.tasks.mailbox.Mail.run(Mail.java:90)
at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.processMailsWhenDefaultActionUnavailable(MailboxProcessor.java:338)
at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.processMail(MailboxProcessor.java:324)
at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:201)
at org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:807)
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:756)
at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:948)
at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:927)
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:741)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:563)
at java.base/java.lang.Thread.run(Unknown Source)Bogdan Chifor
10/09/2023, 7:18 PMMartijn Visser
10/09/2023, 7:43 PMBogdan Chifor
10/09/2023, 7:46 PMMartijn Visser
10/09/2023, 8:09 PMDanny Cranmer
10/09/2023, 8:11 PMBogdan Chifor
10/10/2023, 12:06 AMBogdan Chifor
10/10/2023, 12:06 AMBogdan Chifor
10/10/2023, 12:39 AMstop with savepoint and trigger savepoint and cancelBogdan Chifor
10/10/2023, 5:37 AMtrigger savepoint and cancel (POST on /jobs/:jobid/savepoints with cancel-job: true) will trigger the savepoint, and then cancel the job, in a non atomic operation.Martijn Visser
10/10/2023, 7:06 AMAnother action for stopping a job is stop. It is a more graceful way of stopping a running streaming job as the stop flows from source to sink. When the user requests to stop a job, all sources will be requested to send the last checkpoint barrier that will trigger a savepoint, and after the successful completion of that savepoint, they will finish by calling their cancel() method.Another important bit:
Theflag allows creating a savepoint as part of the job cancellation. This feature is deprecated. Use the stop action instead.--withSavepoint