CodingCat commented on code in PR #2366:
URL: https://github.com/apache/celeborn/pull/2366#discussion_r1565224265


##########
common/src/main/scala/org/apache/celeborn/common/rpc/netty/Inbox.scala:
##########
@@ -173,38 +233,59 @@ private[celeborn] class Inbox(
         message = messages.poll()
         if (message == null) {
           numActiveThreads -= 1
+          signalNotFull()
           return
+        } else {
+          messageCount.decrementAndGet()
+          signalNotFull()
         }
+      } finally {
+        inboxLock.unlock()
       }
     }
   }
 
-  def post(message: InboxMessage): Unit = inbox.synchronized {
-    if (stopped) {
-      // We already put "OnStop" into "messages", so we should drop further 
messages
-      onDrop(message)
-    } else {
-      messages.add(message)
-      false
+  def post(message: InboxMessage): Unit = {
+    try {
+      inboxLock.lockInterruptibly()
+      if (stopped) {
+        // We already put "OnStop" into "messages", so we should drop further 
messages
+        onDrop(message)
+      } else {
+        addMessage(message)
+      }
+      signalNotFull()

Review Comment:
   yeah, this is duplicate, I already signaled in addMessage()



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