[
https://issues.apache.org/jira/browse/HDDS-16789?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rui Wang resolved HDDS-16789.
-----------------------------
Fix Version/s: 2.3.0
Resolution: Fixed
> 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
> 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]