[ 
https://issues.apache.org/jira/browse/HDDS-16789?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rui Wang updated HDDS-16789:
----------------------------
    Component/s: SCM

> Make Buffers.pollAll() allows empty buffer instead of failing on empty deque
> ----------------------------------------------------------------------------
>
>                 Key: HDDS-16789
>                 URL: https://issues.apache.org/jira/browse/HDDS-16789
>             Project: Apache Ozone
>          Issue Type: Sub-task
>          Components: SCM
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.3.0
>
>
> h2. Problem
> `Buffers.pollAll()` in the KeyValue stream write path throws 
> `IllegalStateException` when the internal deque is empty 
> (`Preconditions.checkState(!deque.isEmpty(), ...)`).
> Callers such as `KeyValueStreamDataChannel.drainBuffers()` must guard with 
> `buffers.isEmpty()` before calling `pollAll()`, which duplicates checks and 
> makes the API easy to misuse. However, ideally, drainBuffers on empty buffers 
> can still work by do nothing, and throw an exception does not make sense.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to