flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-7650) Port JobCancellationHandler to new REST endpoint
Date Tue, 26 Sep 2017 16:43:00 GMT

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

ASF GitHub Bot commented on FLINK-7650:
---------------------------------------

Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4697#discussion_r141113862
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/JobCancellationHandler.java
---
    @@ -70,4 +82,25 @@ public JobCancellationHandler(Executor executor, Time timeout) {
     			},
     			executor);
     	}
    +
    +	@Override
    +	public CompletableFuture<EmptyResponseBody> handleRequest(HandlerRequest<EmptyRequestBody,
JobMessageParameters> request, DispatcherGateway gateway) {
    +		final JobID jobId = request.getPathParameter(JobPathParameter.class);
    +
    +		CompletableFuture<Acknowledge> cancelFuture = gateway.cancelJob(jobId, timeout);
    +
    +		return cancelFuture.handle(
    +			(Acknowledge ack, Throwable throwable) -> {
    +				if (throwable != null) {
    +					Throwable error = ExceptionUtils.stripCompletionException(throwable);
    +
    +					throw new CompletionException(
    +						new RestHandlerException(
    +							"Job cancellation failed: " + error.getMessage(),
    --- End diff --
    
    Is the only reason this can fail due to the job not existing?


> Port JobCancellationHandler to new REST endpoint
> ------------------------------------------------
>
>                 Key: FLINK-7650
>                 URL: https://issues.apache.org/jira/browse/FLINK-7650
>             Project: Flink
>          Issue Type: Sub-task
>          Components: REST, Webfrontend
>            Reporter: Tzu-Li (Gordon) Tai
>            Assignee: Till Rohrmann
>              Labels: flip-6
>             Fix For: 1.4.0
>
>
> Port existing {{JobCancellationHandler}} to new REST endpoint



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message