luchunliang commented on code in PR #8320:
URL: https://github.com/apache/inlong/pull/8320#discussion_r1241463657


##########
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/sink/mq/MessageQueueZoneSink.java:
##########
@@ -295,8 +298,10 @@ public void update() {
         if (zoneProducer == null) {
             return;
         }
+        reentrantLock.lock();
         lastNotifyTime.set(System.currentTimeMillis());
-        syncLock.notifyAll();
+        condition.signal();
+        reentrantLock.unlock();

Review Comment:
   It will have problem if condition.signal() have an exception.
   reentrantLock.unlock() need a finally block.



##########
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/sink/mq/MessageQueueZoneSink.java:
##########
@@ -311,14 +316,16 @@ private class ConfigChangeProcessor implements Runnable {
         @Override
         public void run() {
             long lastCheckTime;
+            logger.info("{} config-change processor start!", getName());
             while (!isShutdown) {
+                reentrantLock.lock();

Review Comment:
   When updating metadata, it is not necessary using lock.



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