-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-7789][DataStream API] Add handler for Async IO operator timeouts #5983
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! I left one higher level comment/question.
* @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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be enough to add such timeout()
method to AsyncFunction
with default implementation that fails the ResultFuture
? I mean instead of adding new interface and deprecating AsyncFunction
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review. The deprecated AsyncFunction
is a Java Interface which can not have a method body due to Java grammars. However, your comment make me realize that I just forgot about the Scala API for AsyncFunction
, so there is more work need to be done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can not we add default method here (Java 8 feature)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem :) Please CC me if you open next PR for this issue.
apache#2 take Scala API into account
This PR superseded by #6091 |
What is the purpose of the change
Currently Async IO operator does not provide a mechanism to handle timeouts. This PR fixs the problem by adding an enhanced
AsyncFunction
, namedTimeoutAwareAsyncFunction
.Brief change log
TimeoutAwareAsyncFunction
, which extends theAsyncFunction
RichAsyncFunction
to implementTimeoutAwareAsyncFunction
instead ofAsyncFunction
AsyncWaitOperator
will invokeTimeoutAwareAsyncFunction#timeout
whenasyncInvoke
times outVerifying this change
AsyncWaitOperatorTest
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: ( yes )Documentation