Carl-Zhou-CN commented on code in PR #6408:
URL: https://github.com/apache/seatunnel/pull/6408#discussion_r1730579117


##########
seatunnel-connectors-v2/connector-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/source/reader/fetcher/SplitFetcher.java:
##########
@@ -234,4 +234,19 @@ private void addTaskUnsafe(SplitFetcherTask task) {
         taskQueue.add(task);
         nonEmpty.signal();
     }
+
+    public void enqueueTask(SplitFetcherTask task) {
+        lock.lock();
+        try {
+            enqueueTaskUnsafe(task);
+        } finally {
+            lock.unlock();
+        }
+    }
+
+    private void enqueueTaskUnsafe(SplitFetcherTask task) {
+        assert lock.isHeldByCurrentThread();

Review Comment:
   
![image](https://github.com/user-attachments/assets/87f58c75-96ec-430e-b3db-e2efe2ae3c88)
   I believe that this ReentrantLock usage is the same as depicted in the 
diagram, only occurring during testing and debugging. It can be disabled in 
production, but of course, it can also be enabled for added safety.



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