You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Kiyoshi Mizumaru (Jira)" <ji...@apache.org> on 2022/08/02 18:25:00 UTC

[jira] [Commented] (RATIS-1655) Fix OrderedStreamAsync#scheduleWithTimeout to report a correct timeout value

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

Kiyoshi Mizumaru commented on RATIS-1655:
-----------------------------------------

just filed a PR. please take a look. https://github.com/apache/ratis/pull/701

> Fix OrderedStreamAsync#scheduleWithTimeout to report a correct timeout value
> ----------------------------------------------------------------------------
>
>                 Key: RATIS-1655
>                 URL: https://issues.apache.org/jira/browse/RATIS-1655
>             Project: Ratis
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 2.3.0, 3.0.0, 2.3.1
>            Reporter: Kiyoshi Mizumaru
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> While reading OrderedStreamAsync.java, I noticed that scheduleWithTimeout always reports the value of requestTimeout field wrapped in TimeoutIOException.
>  
> {code:java}
>   private void scheduleWithTimeout(DataStreamWindowRequest request, TimeDuration timeout) {
>     scheduler.onTimeout(timeout, () -> {
>       if (!request.getReplyFuture().isDone()) {
>         request.getReplyFuture().completeExceptionally(
>             new TimeoutIOException("Timeout " + requestTimeout + ": Failed to send " + request));
>       }
>     }, LOG, () -> "Failed to completeExceptionally for " + request);
>   }{code}
> I think this should be timeout, which passed in the following call:
> {code:java}
>     final boolean isClose = StandardWriteOption.CLOSE.isOneOf(request.getDataStreamRequest().getWriteOptions());
>     scheduleWithTimeout(request, isClose? closeTimeout: requestTimeout); {code}
> What do you think?
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)