You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/04/30 00:24:36 UTC

[GitHub] [pulsar] shustsud opened a new pull request #6849: [broker] Fixed IllegalArgumentException issue in Key_Shared

shustsud opened a new pull request #6849:
URL: https://github.com/apache/pulsar/pull/6849


   ### Motivation
   
   If subscription type is Key_Shared, IllegalArgumentException occurs.
   Reproduces when the Replicated subscription is enabled.
   
   Log:
   ```
   14:47:24.297 [bookkeeper-ml-workers-OrderedExecutor-2-0] ERROR o.a.b.common.util.SafeRunnable       - Unexpected throwable caught
   java.lang.IllegalArgumentException: Keys and values must be >= 0
           at org.apache.pulsar.common.util.collections.ConcurrentLongPairSet.checkBiggerEqualZero(ConcurrentLongPairSet.java:503)
           at org.apache.pulsar.common.util.collections.ConcurrentLongPairSet.add(ConcurrentLongPairSet.java:127)
           at org.apache.pulsar.common.util.collections.ConcurrentSortedLongPairSet.add(ConcurrentSortedLongPairSet.java:83)
           at org.apache.pulsar.broker.service.persistent.PersistentStickyKeyDispatcherMultipleConsumers.lambda$sendMessagesToConsumers$2(PersistentStickyKeyDispatcherMultipleConsumers.java:149)
           at java.util.ArrayList.forEach(ArrayList.java:1257)
           at org.apache.pulsar.broker.service.persistent.PersistentStickyKeyDispatcherMultipleConsumers.sendMessagesToConsumers(PersistentStickyKeyDispatcherMultipleConsumers.java:148)
           at org.apache.pulsar.broker.service.persistent.PersistentDispatcherMultipleConsumers.readEntriesComplete(PersistentDispatcherMultipleConsumers.java:460)
           at org.apache.bookkeeper.mledger.impl.OpReadEntry.lambda$checkReadCompletion$2(OpReadEntry.java:146)
           at org.apache.bookkeeper.mledger.util.SafeRun$1.safeRun(SafeRun.java:32)
           at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
           at java.lang.Thread.run(Thread.java:748)
   ```
   
   If sublist contains metadata, element will be null.
    [https://github.com/apache/pulsar/blob/1fd1b2b440af2477f916999a67752f9f532d1620/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java#L114](https://github.com/apache/pulsar/blob/1fd1b2b440af2477f916999a67752f9f532d1620/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java#L114)
   
   This will not remove element from entriesWithSameKey.
    [https://github.com/apache/pulsar/blob/1fd1b2b440af2477f916999a67752f9f532d1620/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java#L122](https://github.com/apache/pulsar/blob/1fd1b2b440af2477f916999a67752f9f532d1620/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java#L122)
   
   ### Modifications
   
   * Fixed PersistentStickyKeyDispatcherMultipleConsumers class.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   ### Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] shustsud commented on pull request #6849: [broker] Fixed IllegalArgumentException issue in Key_Shared

Posted by GitBox <gi...@apache.org>.
shustsud commented on pull request #6849:
URL: https://github.com/apache/pulsar/pull/6849#issuecomment-628276461


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] shustsud commented on pull request #6849: [broker] Fixed IllegalArgumentException issue in Key_Shared

Posted by GitBox <gi...@apache.org>.
shustsud commented on pull request #6849:
URL: https://github.com/apache/pulsar/pull/6849#issuecomment-628312712


   @codelipenghui 
   I added test, so please check 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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] sijie merged pull request #6849: [broker] Fixed IllegalArgumentException issue in Key_Shared

Posted by GitBox <gi...@apache.org>.
sijie merged pull request #6849:
URL: https://github.com/apache/pulsar/pull/6849


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] shustsud commented on pull request #6849: [broker] Fixed IllegalArgumentException issue in Key_Shared

Posted by GitBox <gi...@apache.org>.
shustsud commented on pull request #6849:
URL: https://github.com/apache/pulsar/pull/6849#issuecomment-621618631


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] shustsud commented on pull request #6849: [broker] Fixed IllegalArgumentException issue in Key_Shared

Posted by GitBox <gi...@apache.org>.
shustsud commented on pull request #6849:
URL: https://github.com/apache/pulsar/pull/6849#issuecomment-621596809


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org