Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-1655

Fix OrderedStreamAsync#scheduleWithTimeout to report a correct timeout value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.0, 3.0.0
    • 2.4.0, 3.0.0
    • server
    • None

    Description

      While reading OrderedStreamAsync.java, I noticed that scheduleWithTimeout always reports the value of requestTimeout field wrapped in TimeoutIOException.

       

        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);
        }

      I think this should be timeout, which passed in the following call:

          final boolean isClose = StandardWriteOption.CLOSE.isOneOf(request.getDataStreamRequest().getWriteOptions());
          scheduleWithTimeout(request, isClose? closeTimeout: requestTimeout); 

      What do you think?

       

      Attachments

        Issue Links

          Activity

            People

              kmizumar Kiyoshi Mizumaru
              kmizumar Kiyoshi Mizumaru
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m