[
https://issues.apache.org/jira/browse/FLINK-7789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16495166#comment-16495166
]
ASF GitHub Bot commented on FLINK-7789:
---------------------------------------
Github user pnowojski commented on a diff in the pull request:
https://github.com/apache/flink/pull/6091#discussion_r191767070
--- Diff:
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/operators/async/AsyncWaitOperatorTest.java
---
@@ -648,6 +662,52 @@ public void testAsyncTimeout() throws Exception {
ExceptionUtils.findThrowable(mockEnvironment.getActualExternalFailureCause().get(),
TimeoutException.class);
}
+ @Test
+ public void testAsyncTimeoutAware() throws Exception {
--- End diff --
Please deduplicate the code of this method with `testAsyncTimeout()` to sth
like that:
```
@Test
public void testAsyncTimeoutFailure() throws Exception {
testAsyncTimeout(
new LazyAsyncFunction()
Optional.of(TimeoutException.class),
new StreamRecord<>(2, 5L));
}
public void testAsyncTimeoutIgnore() throws Exception {
testAsyncTimeout(
new IgnoreTimeoutLazyAsyncFunction()
Optional.of(TimeoutException.class),
new StreamRecord<>(6, 0L),
new StreamRecord<>(4, 5L));
}
private void testAsyncTimeout(
Optional<Class<?>> expectedException,
StreamRecord<Integer>... expectedRecords) throws Exception {
// your current testAsyncTimeoutAware method body adjusted to above
parameters
}
```
or sth similar.
> 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)