alexeykudinkin commented on code in PR #7582:
URL: https://github.com/apache/hudi/pull/7582#discussion_r1066070324


##########
hudi-common/src/main/java/org/apache/hudi/common/util/queue/DisruptorMessageQueue.java:
##########
@@ -60,6 +61,12 @@ public long size() {
 
   @Override
   public void insertRecord(I value) throws Exception {
+    if (!isStart) {
+      synchronized (this) {
+        wait();
+      }
+    }

Review Comment:
   @boneanxs Disruptor is a *lock-free* message queue, let's avoid taking the 
locks in the hot-path to avoid defeating its purpose.
   
   Instead we should do the following: 
   
   1. We set the flag `started` in the `start` method
   2. We assert in `insertRecord` that the queue is started
   3. We fix the start-up sequence for Disruptor to make sure we start consumer 
before producer



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