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:19:00 UTC
[jira] [Created] (RATIS-1655) Fix OrderedStreamAsync#scheduleWithTimeout to report a correct timeout value
Kiyoshi Mizumaru created RATIS-1655:
---------------------------------------
Summary: 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
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)