[
https://issues.apache.org/jira/browse/FLINK-13635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Biao Liu closed FLINK-13635.
----------------------------
Resolution: Won't Fix
This scenario should not exist anymore after integrating AsyncWaitOperator with
mailbox threading model. [[email protected]]
> Unexpectedly interrupted in AsyncFunction#timeout
> -------------------------------------------------
>
> Key: FLINK-13635
> URL: https://issues.apache.org/jira/browse/FLINK-13635
> Project: Flink
> Issue Type: Improvement
> Components: API / DataStream
> Affects Versions: 1.9.0
> Reporter: Biao Liu
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.10.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Currently the way of handling {{AsyncFunction#timeout}} is a bit weird in
> {{AsyncWaitOperator#processElement}}.
>
> There are two methods in {{AsyncFunction}}, {{asyncInvoke}} and {{timeout}}.
> The {{asyncInvoke}} is executed in task thread, while the {{timeout}} is
> executed in system time service. When the {{asyncInvoke}} finished, it might
> complete the {{ResultFuture}}. Then it cancels the registered timer of
> {{timeout}}. However there is no any synchronization between the
> {{asyncInvoke}}, {{timeout}} and the cancelation. Moreover this cancelation
> is with interruption enabled.
> The {{timeout}} must be implemented very carefully. Because when the
> {{timeout}} is executing, there might be an interruption triggered at the
> same time (due to a completion of {{ResultFuture}}). That means the
> {{timeout}} must handle {{InterruptedException}} well everywhere if there is
> any operation reacting with this exception.
> My proposals are described below.
> 1. It should be written down in document that the {{asyncInvoke}} and
> {{timeout}} might be invoked at the same time.
> 2. This interruption of {{timeout}} should be avoided. There should be a
> synchronization between cancelation and {{timeout}}. If the {{timeout}} is
> executing, the cancelation should be avoided. If the cancelation has been
> invoked, this {{timeout}} should not be invoked anymore. Or we could simply
> cancel the timer without an interruption.
> CC [~kkl0u], [~till.rohrmann]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)