This is an automated email from the ASF dual-hosted git repository.

mxsm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new c93fc3ea2 [ISSUE #4778] Fix Standalone MessageQueue does not down 
counter when dequeue (#4779)
c93fc3ea2 is described below

commit c93fc3ea24e13dbc5cb4d3ec42a49f617fd2de09
Author: Karson <[email protected]>
AuthorDate: Thu Feb 22 00:28:49 2024 +0800

    [ISSUE #4778] Fix Standalone MessageQueue does not down counter when 
dequeue (#4779)
    
    * bug fix
    
    * bug fix
---
 .../org/apache/eventmesh/storage/standalone/broker/MessageQueue.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/eventmesh-storage-plugin/eventmesh-storage-standalone/src/main/java/org/apache/eventmesh/storage/standalone/broker/MessageQueue.java
 
b/eventmesh-storage-plugin/eventmesh-storage-standalone/src/main/java/org/apache/eventmesh/storage/standalone/broker/MessageQueue.java
index 232a4ad74..64b8fe462 100644
--- 
a/eventmesh-storage-plugin/eventmesh-storage-standalone/src/main/java/org/apache/eventmesh/storage/standalone/broker/MessageQueue.java
+++ 
b/eventmesh-storage-plugin/eventmesh-storage-standalone/src/main/java/org/apache/eventmesh/storage/standalone/broker/MessageQueue.java
@@ -236,10 +236,11 @@ public class MessageQueue {
      * @return The MessageEntity object at the head of the queue.
      */
     private MessageEntity dequeue() {
-        MessageEntity item = items[takeIndex++];
+        final MessageEntity item = items[takeIndex++];
         if (takeIndex == items.length) {
             takeIndex = 0;
         }
+        count--;
         notFull.signalAll();
         return item;
     }


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

Reply via email to