[ https://issues.apache.org/jira/browse/FLINK-7789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16488865#comment-16488865 ]
ASF GitHub Bot commented on FLINK-7789: --------------------------------------- Github user kisimple commented on a diff in the pull request: https://github.com/apache/flink/pull/5983#discussion_r190560531 --- Diff: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/async/TimeoutAwareAsyncFunction.java --- @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.streaming.api.functions.async; + +import org.apache.flink.annotation.PublicEvolving; + +/** + * An enhanced {@link AsyncFunction} which can handle timeouts. + */ +@PublicEvolving +public interface TimeoutAwareAsyncFunction<IN, OUT> extends AsyncFunction<IN, OUT> { + + /** + * asyncInvoke timeout occurred. + * Here you can complete the result future exceptionally with timeout exception, + * or complete with empty result. You can also retry to complete with the right results. + * + * @param input element coming from an upstream task + * @param resultFuture to be completed with the result data + * @exception Exception in case of a user code error. An exception will make the task fail and + * trigger fail-over process. + */ + void timeout(IN input, ResultFuture<OUT> resultFuture) throws Exception; --- End diff -- Sorry for that I did not pay so much attention to new features. I will try and if it works I will close this PR and open a new one. Thanks:) > Add handler for Async IO operator timeouts > ------------------------------------------- > > Key: FLINK-7789 > URL: https://issues.apache.org/jira/browse/FLINK-7789 > Project: Flink > Issue Type: Improvement > Components: DataStream API > Reporter: Karthik Deivasigamani > Assignee: blues zheng > Priority: Major > > Currently Async IO operator does not provide a mechanism to handle timeouts. > When a request times out it an exception is thrown and job is restarted. It > would be good to pass a AsyncIOTimeoutHandler which can be implemented by the > user and passed in the constructor. > Here is the discussion from apache flink users mailing list > http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/async-io-operator-timeouts-tt16068.html -- This message was sent by Atlassian JIRA (v7.6.3#76005)