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

Tsz-wo Sze edited comment on RATIS-2270 at 3/24/25 3:31 PM:
------------------------------------------------------------

[~zhanghaobo], thanks for checking the code!

In OrderedAsync (and OrderedStreamAsync), we already have a requestSemaphore to 
limit the number of outstanding requests.  So, we don't have to limit the size 
of DelayedRequests in SlidingWindow.

The abstraction is that SlidingWindow does not limit the number of outstanding 
requests for simplicity reason.  The caller has to it since seqNum is not yet 
assigned at that time.


was (Author: szetszwo):
In OrderedAsync (and OrderedStreamAsync), we already have a requestSemaphore to 
limit the number of outstanding requests.  So, we don't have to limit the size 
of DelayedRequests in SlidingWindow.

The abstraction is that SlidingWindow does not limit the number of outstanding 
requests for simplicity reason.  The caller has to it since seqNum is not yet 
assigned at that time.

> Limit the size of DelayedRequests to prevent Client OOM
> -------------------------------------------------------
>
>                 Key: RATIS-2270
>                 URL: https://issues.apache.org/jira/browse/RATIS-2270
>             Project: Ratis
>          Issue Type: Improvement
>            Reporter: farmmamba
>            Priority: Major
>
> In method org.apache.ratis.util.SlidingWindow.Client#sendOrDelayRequest, we 
> always put new request seqNum into delayedRequests, which may cause OOM when 
> firstReplied == false.



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

Reply via email to