[ 
https://issues.apache.org/jira/browse/FLINK-9389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17275710#comment-17275710
 ] 

DILJIT POOVAKOTIL RAMACHANDRAN commented on FLINK-9389:
-------------------------------------------------------

[~uce] I tried reproducing this on my local machine, it still appears. However 
I see a bunch of java stack trace with the error message which is kind of ug. 
Can I work on this?

The current error response from the api looks like:

{"errors":["org.apache.flink.runtime.rest.handler.RestHandlerException: Job 
could not be found.\n\tat 
org.apache.flink.runtime.rest.handler.job.JobCancellationHandler.lambda$handleRequest$0(JobCancellationHandler.java:119)\n\tat
 
java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:836)\n\tat
 
java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:811)\n\tat
 
java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488)\n\tat
 java.util.concurrent.CompletableFuture.completeExcept

> Improve error message when cancelling job in state canceled via REST API
> ------------------------------------------------------------------------
>
>                 Key: FLINK-9389
>                 URL: https://issues.apache.org/jira/browse/FLINK-9389
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / REST
>    Affects Versions: 1.5.0
>            Reporter: Ufuk Celebi
>            Priority: Minor
>              Labels: starter
>
> - Request job that has been already cancelled
> {code}
> $ curl http://localhost:8081/jobs/b577a914ecdf710d4b93a84105dea0c9
> {"jid":"b577a914ecdf710d4b93a84105dea0c9","name":"CarTopSpeedWindowingExample","isStoppable":false,"state":"CANCELED",
>  ...omitted...}
> {code}
> - Cancel job again
> {code}
> $ curl -XPATCH 
> http://localhost:8081/jobs/b577a914ecdf710d4b93a84105dea0c9\?mode\=cancel
> {"errors":["Job could not be found."]} (HTTP 404)
> {code}
> Since the actual job resource still exists, I think status code 404 is 
> confusing. I think a better message should indicate that the job is already 
> in state CANCELED.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to