Hi Thomas,

I think you are right that the CLI is also using the same rest API underlying, 
and since
the response of the rest API is ok and the savepoint is triggered successfully, 
I reckon
that it might not be due to rest API process, and we might still first focus on 
the 
stop-with-savepoint process.

Currently stop-with-savepoint would first do a savepoint, then cancel all the 
sources to 
stop the job. Thus are the sources all legacy source (namely the one using 
SourceFunction) ? 
and does the source implement the cancel() method correctly ?

Best,
Yun


------------------------------------------------------------------
From:Thomas Wang <w...@datability.io>
Send Time:2021 Jun. 4 (Fri.) 12:55
To:user <user@flink.apache.org>
Subject:Failed to cancel a job using the STOP rest API

Hi, Flink community,

I'm trying to use the STOP rest API to cancel a job. So far, I'm seeing some 
inconsistent results. Sometimes, jobs could be cancelled successfully while 
other times, they couldn't. Either way, the POST request is accepted with a 
status code 202 and a "request-id".

From the Flink UI, I can see the savepoint being completed successfully. 
However the job is still in running state afterwards. The CLI command `flink 
stop <JOB ID>` is working ok. I can use the CLI to stop the job and get the 
resulting savepoint location. If I understand this correctly, the CLI should be 
using the same REST API behind the scenes, isn't it?

Here is my POST request URL: 
`http://<HIDDEN>.ec2.internal:33557/jobs/5dce58f02d1f5e739ab12f88b2f5f031/stop`.

Here is the BODY of the request: 
`{"drain":false,"targetDirectory":"s3://<BUCKET-NAME>/flink-savepoint"}`.

I'm using Flink 1.11.2 Commit ID: DeadD0d0.

Any suggestions on how I can debug this?

Another question is, given the response "request-id", which endpoint should I 
query to get the status of the request? Most importantly, where can I get the 
expected savepoint location?

Thanks.

Thomas

Reply via email to