jojochuang commented on code in PR #6777:
URL: https://github.com/apache/ozone/pull/6777#discussion_r1628597889


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyOutputStream.java:
##########
@@ -205,8 +209,10 @@ public synchronized void write(byte[] b, int off, int len)
     if (len == 0) {
       return;
     }
-    handleWrite(b, off, len, false);
-    writeOffset += len;
+    synchronized (this) {
+      handleWrite(b, off, len, false);

Review Comment:
   handleWrite() calls allocateBlockIfNeeded() which means it's going to get 
blocked waiting for OM response, which is fine. It doesn't happen frequent so 
shouldn't be a big deal. We can revisit later if it turns out to be not the 
case.



-- 
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]


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

Reply via email to