BewareMyPower commented on issue #23825:
URL: https://github.com/apache/pulsar/issues/23825#issuecomment-2733052725

   This flaky test could be easily reproduced when  debugging the whole 
`BatchMessageTest`.
   
   I added debugging code before the assertion:
   
   ```java
           final var numMessagesInQueue = consumer1.numMessagesInQueue();
           if (Math.abs(numMessagesInQueue - batchMessages) > batchMessages) {
               log.info("XYZ numMessagesInQueue is {}", numMessagesInQueue);
               for (int i = 0; i < numMessagesInQueue; i++) {
                   final var msg = consumer1.receive();
                   final var msgId = (MessageIdAdv) msg.getMessageId();
                   log.info("XYZ received {} from {}:{}:{}", new 
String(msg.getValue()), msgId.getLedgerId(),
                           msgId.getEntryId(), msgId.getBatchIndex());
               }
           }
   ```
   
   and here is an example of the outputs:
   
   ```
   2025-03-18T20:21:52,679 - INFO  - [main:BatchMessageTest] - XYZ 
numMessagesInQueue is 80
   2025-03-18T20:21:52,679 - INFO  - [main:BatchMessageTest] - XYZ received 
my-message-0 from 9:0:0
   2025-03-18T20:21:52,679 - INFO  - [main:BatchMessageTest] - XYZ received 
my-message-1 from 9:0:1
   2025-03-18T20:21:52,679 - INFO  - [main:BatchMessageTest] - XYZ received 
my-message-2 from 9:0:2
   ...
   2025-03-18T20:21:52,682 - INFO  - [main:BatchMessageTest] - XYZ received 
my-message-77 from 9:7:7
   2025-03-18T20:21:52,682 - INFO  - [main:BatchMessageTest] - XYZ received 
my-message-78 from 9:7:8
   2025-03-18T20:21:52,682 - INFO  - [main:BatchMessageTest] - XYZ received 
my-message-79 from 9:7:9
   ```
   
   So there should be a regression on for 
https://github.com/apache/pulsar/pull/7266, which takes the number of messages 
in count when dispatching messages in `Shared` subscriptions. I assigned it to 
myself and I'm trying to fix it.


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