rdhabalia opened a new pull request #5391: [pulsar-broker] Fix: race condition : Failed to read-more entries on dispatcher URL: https://github.com/apache/pulsar/pull/5391 ### Motivation Due to race condition on `messagesToRedeliver`, dispatcher tries to access `delayedDeliveryTracker` which is empty and it is getting below exception so, dispatcher is not able to read entries. ``` 22:05:03.693 [pulsar-io-22-7] WARN io.netty.util.concurrent.AbstractEventExecutor - A task raised an exception. Task: org.apache.pulsar.broker.service.persisten t.PersistentDispatcherMultipleConsumers$$Lambda$965/0x0000000800912840@cdfd37a java.util.NoSuchElementException: No value present at java.util.Optional.get(Optional.java:148) ~[?:?] at org.apache.pulsar.broker.service.persistent.PersistentDispatcherMultipleConsumers.getMessagesToReplayNow(PersistentDispatcherMultipleConsumers.java:728) ~[pulsar-broker-2.4.3-yahoo.jar:2.4.3-yahoo] at org.apache.pulsar.broker.service.persistent.PersistentDispatcherMultipleConsumers.readMoreEntries(PersistentDispatcherMultipleConsumers.java:298) ~[pulsar-broker-2.4.3-yahoo.jar:2.4.3-yahoo] at org.apache.pulsar.broker.service.persistent.PersistentDispatcherMultipleConsumers.lambda$addUnAckedMessages$374(PersistentDispatcherMultipleConsumers.java:646) ~[pulsar-broker-2.4.3-yahoo.jar:2.4.3-yahoo] at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [netty-all-4.1.32.Final.jar:4.1.32.Final] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) [netty-all-4.1.32.Final.jar:4.1.32.Final] at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:335) [netty-all-4.1.32.Final.jar:4.1.32.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909) [netty-all-4.1.32.Final.jar:4.1.32.Final] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.32.Final.jar:4.1.32.Final] at java.lang.Thread.run(Thread.java:834) [?:?] ``` With this fix, dispatcher will atomically fetches replay-messages without accessing `delayedDeliveryTracker`.
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
