cshannon commented on code in PR #3151:
URL: https://github.com/apache/accumulo/pull/3151#discussion_r1063615752


##########
core/src/main/java/org/apache/accumulo/core/data/Value.java:
##########
@@ -181,6 +182,15 @@ public void readFields(final DataInput in) throws 
IOException {
     in.readFully(this.value, 0, this.value.length);
   }
 
+  public void readFields(final DataInput in, Supplier<Long> 
freeMemorySupplier) throws IOException {
+    int length = in.readInt();
+    while (freeMemorySupplier.get() < length) {
+      Thread.onSpinWait();
+    }
+    this.value = new byte[length];

Review Comment:
   Maybe we need to have some configurable size to give us a bit of a buffer 
that we add to the check that could help reduce risk of failures due to race 
conditions. So instead of just continuing if `free_memory` is large enough, we 
don't continue until `free_memory + some_configurable_size` (could be a meg, 10 
megs, whatever) of memory is available to reduce the risk of failures.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to