Details
-
Sub-task
-
Status: Resolved
-
Blocker
-
Resolution: Implemented
-
None
-
None
-
None
-
None
-
It is done inside
HDDS-9844.
Description
Since HDDS-9844, multiple threads can now invoke hsync to flush current changes in the BlockOutputStream. Each hsync call requires a ChunkBuffer in the BufferPool to be reserved until the flush is committed.
The current BufferPool implementation imposes a hard limit and will crash when this limit is crossed. This is when BlockOutputStream is used by a single thread at a time. But when a variable number of threads call hsync on a single BlockOutputStream, this limit is easy to cause a crash.
We need to improve the BufferPool/BlockOutputStream so that it does not crash when there are more ChunkBuffer allocation requests than the configured BufferPool limit. Instead, the calling thread can wait until an available buffer is released.