-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
Description
Search before asking
- I searched in the issues and found nothing similar.
Version
latest.
Minimal reproduce step
ConcurrentLongLongPairHashMap use optimistic locking to read data in Section, but if there is another thread that is removing data from the same Section, and trigger the shrink process, then the index calculated basing on dirty capacity exceed the array size, an ArrayIndexOut0fBoundsException will be throw, which is not handled now. Eventually the connection with client will be closed.

What did you expect to see?
,
What did you see instead?
WARN org.apache.pulsar.broker.service.Servernx-[] Got exception, cause: java.lang.ArrayIndexOut0fBoundsException: Index 6821 out of bounds for length 4
096, stackTrace: java.lang.ArrayIndexOutOfBoundsException: Index 6821 out of bounds for length 4096
atorg.apache.pulsar.common.util.collections.ConcurrentLongLongPairHashMap$Section.get(ConcurrentLongLongPairHashMap.java:331)
atorg.apache.pulsar.common.util.collections.ConcurrentLongLongPairHashMap.get(ConcurrentLongLongPairHashMap.java:204)
at org.apache.pulsar.common.util.collections.ConcurrentLongLongPairHashMap.containsKey(ConcurrentLongLongPairHashMap.java:208)
at org.apache.pulsar.broker.service.Consumer.getAckOwnerConsumer(Consumer.java:596)
at org.apache.pulsar.broker.service.Consumer.individualAckNormal(Consumer.java:408)
at org.apache.pulsar.broker.service.Consumer.messageAcked(Consumer.java:395)
at org.apache.pulsar .broker .service.ServerCnx.handleAck(Server(nx.java:1456)
at org.apache.pulsar.common.protocol.PulsarDecoder.channelRead(PulsarDecoder.java:145)
Anything else?
No response
Are you willing to submit a PR?
- I'm willing to submit a PR!