You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "michalcukierman (via GitHub)" <gi...@apache.org> on 2023/08/31 11:14:46 UTC

[GitHub] [pulsar] michalcukierman opened a new issue, #21104: [Bug] Client with shared subscription is blocked

michalcukierman opened a new issue, #21104:
URL: https://github.com/apache/pulsar/issues/21104

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Version
   
   Client - 3.1.0
   Pulsar - 3.1.0 (and later builds)
   
   Also reported on 3.0.1
   
   ### Minimal reproduce step
   
   My reproducible steps:
   1. Create persistent topic with 3 partitions
   2. Publish 1 mln messages (30KB)
   3. Run the client and consumer:
   
   ```java
       PulsarClient client = PulsarClient.builder()
           .serviceUrl(this.pulsarBrokerUrl)
           .build();
   
       Consumer consumer = client.newConsumer()
           .topic(sourceTopic)
           .subscriptionInitialPosition(SubscriptionInitialPosition.Earliest)
           .subscriptionName(subscriptionName)
           .subscriptionType(SubscriptionType.Shared)
           .receiverQueueSize(8)
           .ackTimeout(5, TimeUnit.SECONDS)
           .subscribe();
   ```
   
   
   ### What did you expect to see?
   
   All messages are received
   
   ### What did you see instead?
   
   Client stops to receive messages, restart client helps, but it get stuck after some time.
   
   
   ### Anything else?
   
   The issue was originally created described here: #21082
   @MichalKoziorowski-TomTom also faces the issue.
   
   I've created new issue, because it in #21082 the author says that broker restart helps. In case of this issue, it looks like it's client related and some race condition observed in 3.x.x. after introducing `ackTimeout`
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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: commits-unsubscribe@pulsar.apache.org.apache.org

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


[GitHub] [pulsar] lvdelu commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "lvdelu (via GitHub)" <gi...@apache.org>.
lvdelu commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1735271449

   how about fix deadline ? 


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "poorbarcode (via GitHub)" <gi...@apache.org>.
poorbarcode commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1779028476

   @michalcukierman 
   
   I left a comment [here](https://github.com/apache/pulsar/issues/21082#issuecomment-1778909021)


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] mattisonchao commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "mattisonchao (via GitHub)" <gi...@apache.org>.
mattisonchao commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1728959546

   HI, @michalcukierman 
   
   I created a [repo](https://github.com/mattisonchao/issue-pulsar-21104) to reproduce this issue. But no luck. 
   Could you please help me to refine this test?


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] michalcukierman commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1702690833

   Here are the alternative stats:
   https://github.com/apache/pulsar/issues/21082#issuecomment-1698836870


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "dao-jun (via GitHub)" <gi...@apache.org>.
dao-jun commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-2140860378

   > I've noticed that with Client 3.2.2 the behavior may be a bit different. The consumers get blocked, but occasionally resume. After a couple messages received are stuck again. Stats are uploaded: https://github.com/michalcukierman/pulsar-21104/tree/main/stats
   > 
   > I've confirmed once again, the issue does not occur with Pulsar Client 3.0.4 (or at least I was not able to reproduce it after processing 1 mln messages. With Client 3.2.2 usually clients are blocked after 50k messages).
   
   I check the [stats](https://github.com/michalcukierman/pulsar-21104/blob/main/stats/stats-0) and the [internal-stats](https://github.com/michalcukierman/pulsar-21104/blob/main/stats/stats-internal-0),
   As I can see, there is about 30k messages in the topic, and there is a subscription named `request-shared-subscription` to consume the topic, but it seems none of the messages acknowledged, the `markDeletedPosition` is `0:-1` and `individuallyDeletedMessages` is empty:
   ![image](https://github.com/apache/pulsar/assets/21362791/7e76c3fb-bd42-4a9e-89fe-d2ad1008b687)
   
   Which means all the messages are unacked, or, in the backlog.
   And I checked the `stats`, for the consumer of `request-shared-subscription`. I can see `msgOutCounter=10002` which means how many messages dispatched to the consumer, `unackedMessages=10001` means 10001 messages are unacked.
   So, obviously, you only receive messages but didn't ack messages.
   
   I guess the configuration `maxUnackedMessagesPerConsumer` in your `broker.conf` is `10000`. So, since the `unackedMessages=10001` exceeds the `maxUnackedMessagesPerConsumer=10000`, so the `blockedConsumerOnUnackedMsgs` field in the `stats` is true.
   ![image](https://github.com/apache/pulsar/assets/21362791/41c28fb2-6cf3-4e2e-80a6-b3b6d16fed84)
   
   Which means there are toooo many unacked messages on the consumer so that the consumer stopped dispatch messages to clients.
   
   Please ack message after process successfully.
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "MichalKoziorowski-TomTom (via GitHub)" <gi...@apache.org>.
MichalKoziorowski-TomTom commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-2071870500

   @michalcukierman Could you recheck your case? I've checked my case and I can't reproduce with 3.0.4 client while it was easily reproducible with 3.0.1. Test with version that includes https://github.com/apache/pulsar/issues/22352 fix. 


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] michalcukierman commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1702721193

   I think it happens:
   - there is ackTimeout set on a consumer
   - high throughput
   - the receviverQueue size is low
   
   There may be a race condition in 3.1.0 client, as the situation was not observed with 2.10.4 (we've downgraded, also @MichalKoziorowski-TomTom reported this as a fix).
   
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] codelipenghui commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "codelipenghui (via GitHub)" <gi...@apache.org>.
codelipenghui commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1701226899

   @michalcukierman Could you please share the topic stats and internal-stats when the issue is reproduced? 


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-2140747321

   @poorbarcode have you had chance to see the last comment?


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] michalcukierman commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1741559266

   I've tried to create isolated environment to reproduce the issue on local machine using test containers, but I was not able today.
   The environment I observe the issue is a GCP cluster with:
   - 5 x Bookkeeper
   - 3 x Broker
   - 3 x Proxy
   
   It also happens on randomly, with 1 million messages It sometimes get stuck around 300k-500k messages, but it is not deterministic. I'll try to reproduce the issue on GCP, but I'll need more time.


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] michalcukierman commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1710420794

   Happened today again on different module. 
   
   topic - not partitioned, without retention
   messages - 50k, around 5k each
   subscription - shared, with two clients
   
   The solution is to use 2.10.4 client for now.


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] MichalKoziorowski-TomTom commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "MichalKoziorowski-TomTom (via GitHub)" <gi...@apache.org>.
MichalKoziorowski-TomTom commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1705030965

   We don't have ackTimeout and it still happens. 


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-6381731107

   Thanks for the detailed reproduction work, @michalcukierman and everyone who added data. The last stats showed the subscription with no acknowledged messages and the consumer blocked at maxUnackedMessagesPerConsumer, the 3.0.4 client (with the #22352 ack fix) didn't reproduce it, and the clients and brokers used here (3.1.x, 3.2.x) are no longer supported. Could you check whether it still happens with a client and broker on a currently supported release (4.0.x, 4.2.x or 5.0.x), and if so share topic stats and stats-internal from when it's stuck plus a client thread dump? If there's no update, this issue will be closed in a few weeks.


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-2098243387

   I've noticed that with 3.2.2 the behavior may be a bit different. The consumers get blocked, but occasionally resume. After a couple messages received are stuck again.
   Stats are uploaded:
   https://github.com/michalcukierman/pulsar-21104/tree/main/stats
    


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-2142749993

   This code creates a pipeline with the source-processor-sink. Sink ACK triggers source ACK.
   ```
   @ApplicationScoped
   public class Processor {
   
     private final AtomicLong inCount = new AtomicLong(0);
     @Incoming("requests-in")
     @Outgoing("dump-out")
     @Blocking
     PulsarOutgoingMessage<String> process(PulsarIncomingMessage<String> in) {
       System.out.println(" - Processed: " + inCount.incrementAndGet());
       return PulsarOutgoingMessage.from(in);
     }
   }
   ```
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] michalcukierman commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1729408030

   @mattisonchao 
   I'll have a time next week to get back to 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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] mattisonchao commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "mattisonchao (via GitHub)" <gi...@apache.org>.
mattisonchao commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1736591562

   @lvdelu 
   Could you help to refine this test to help reproduce it?
   [repo](https://github.com/mattisonchao/issue-pulsar-21104)


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] michalcukierman commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1706989228

   Here is the exact payload:
   [30k.html.zip](https://github.com/apache/pulsar/files/12526279/30k.html.zip)
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "MichalKoziorowski-TomTom (via GitHub)" <gi...@apache.org>.
MichalKoziorowski-TomTom commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-2045127525

   It might be fixed with https://github.com/apache/pulsar/issues/22352. Need to check...


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1788215405

   Both issues are not related, In both cases the subscriptions are blocked, but in this case the restart of the broker didn't help.
   @poorbarcode have you tried the repository I've linked?
    https://github.com/michalcukierman/pulsar-21104
    It's possible to reproduce it on GCP cluster.


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-2142747801

   @dao-jun,
   
   The whole source code with the instructions on how to run it is available in the linked repository.
   Note that the same example works when downgrading the client to 3.0.4 (see the videos).
   https://github.com/apache/pulsar/issues/21104#issuecomment-2098254335
   
   The message acknowledgment should be done after getting write confirmation from the producer. 
   https://github.com/apache/pulsar/issues/21104#issuecomment-1743609860
   
   This is the original code that was failing. We are no longer using it because we've decommissioned the module.:
   https://github.com/apache/pulsar/issues/21104#issuecomment-1702584503
   
   https://github.com/apache/pulsar/issues/21104 was created as a reproducible example.
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] michalcukierman commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1702584503

   Two files attached:
   [partitioned.stats.internal.txt](https://github.com/apache/pulsar/files/12497246/partitioned.stats.internal.txt)
   [partitioned.stats.txt](https://github.com/apache/pulsar/files/12497248/partitioned.stats.txt)
   
   I see that in stats we have:
   ```
           "availablePermits" : 0,
           "unackedMessages" : 25,
   
           "availablePermits" : 0,
           "unackedMessages" : 32,
   ```
   
   , but I do ack all of the messages:
   ```java
       Consumer consumer = client.newConsumer()
           .topic(sourceTopic)
           .subscriptionInitialPosition(SubscriptionInitialPosition.Earliest)
           .subscriptionName(subscriptionName)
           .subscriptionType(SubscriptionType.Shared)
           .receiverQueueSize(8)
           .ackTimeout(ackTimeout, TimeUnit.SECONDS)
           .subscribe();
   
       Producer<byte[]> producer = client.newProducer(Schema.BYTES)
           .topic(destinationTopic)
           .compressionType(CompressionType.LZ4)
           .maxPendingMessages(8)  // Support 5 MB files
           .blockIfQueueFull(true) // Support 5 MB files
           .batchingMaxBytes(5242880)
           .create();
   
       Multi<Messagemessages = Multi.createBy().repeating()
           .completionStage(consumer::receiveAsync)
           .until(m -> closed.get());
   
       messages.subscribe().with(msg -> {
         receivedDistribution.record(getKiloBytesSize(msg.getData()));
         Uni.createFrom().completionStage(producer.newMessage(Schema.BYTES)
                 .key(msg.getKey())
                 .value(msg.getValue().getContent().getPayload().toByteArray())
                 .eventTime(msg.getEventTime()).sendAsync())
             .subscribe().with(msgId -> {
               sentCounter.increment();
               try {
                 consumer.acknowledge(msg.getMessageId());
               } catch (PulsarClientException e) {
                 throw new RuntimeException("Unable to send or ACK the message", e);
               }
             });
       });
     }
   ```
   It can be confirmed in the log files, where sentCounter is just on message behind 
   <img width="1165" alt="Screenshot 2023-09-01 at 13 11 49" src="https://github.com/apache/pulsar/assets/4356553/71eac4c5-9f9a-4626-aeee-e89cf125e19c">
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] redoc123 commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "redoc123 (via GitHub)" <gi...@apache.org>.
redoc123 commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1706969773

   you said 1 million messages right? Could you post your sample payload? I want to reproduce and debug. 


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] michalcukierman commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1706986765

   It's 1 mln x 30 kb of sample HTML file. Any text file would be good.
   What we are doing:
   
   `topic:source ( 1mln x 30k)` -> ` app:router` ->  `topic:destination`
   
   `source` has 3 partitions
   `destination` has 6 partitions
   Router has 2 replicas, uses shared subscription to read from `source`, writing to `destination` and ack's incoming message once the message is stored and acked on `destination`
   
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] mattisonchao commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "mattisonchao (via GitHub)" <gi...@apache.org>.
mattisonchao commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1711003256

   I'll try to reproduce it and get back to you. :) 


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] lvdelu commented on issue #21104: [Bug] Client with shared subscription is blocked

Posted by "lvdelu (via GitHub)" <gi...@apache.org>.
lvdelu commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1707613023

   +1,it seems also occurred  in other consumer mode(shared,keyshared)


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-1743609860

   It looks like I was able to reproduce the issue in the first run today.
   - I've created SmallRye project (one producer to produce 1 mln messages, one consumer to read it using shared subscription)
   - The cluster is created on GCP using Pulsar operator from SN (great tool!)
   
   The code is here:
   https://github.com/michalcukierman/pulsar-21104
   
   In general it's very much like in the bug description. Produce 1 mln messages of 30kb:
   ```java
     @Outgoing("requests-out")
     public Multi<String> produce() {
       return Multi.createBy().repeating()
           .uni(() -> Uni
               .createFrom()
               .item(() -> RandomStringUtils.randomAlphabetic(30_000))
               .onItem()
               .invoke(() -> System.out.println("+ Produced: " + outCount.incrementAndGet()))
           )
           .atMost(1_000_000);
     }
   ```
   
   Read it using shared client and write to another topic:
   ```java
   @ApplicationScoped
   public class Processor {
   
     private final AtomicLong inCount = new AtomicLong(0);
     @Incoming("requests-in")
     @Outgoing("dump-out")
     @Blocking
     PulsarOutgoingMessage<String> process(PulsarIncomingMessage<String> in) {
       System.out.println(" - Processed: " + inCount.incrementAndGet());
       return PulsarOutgoingMessage.from(in);
     }
   }
   ```
   
   The settings of the client are:
   ```
   pulsar.client.serviceUrl=pulsar://brokers-broker:6650
   
   mp.messaging.incoming.requests-in.subscriptionType=Shared
   mp.messaging.incoming.requests-in.numIoThreads=4
   mp.messaging.incoming.requests-in.subscriptionName=request-shared-subscription
   mp.messaging.incoming.requests-in.ackTimeoutMillis=5000
   mp.messaging.incoming.requests-in.subscriptionInitialPosition=Earliest
   mp.messaging.incoming.requests-in.receiverQueueSize=8
   mp.messaging.incoming.requests-in.topic=persistent://public/default/requests_4
   mp.messaging.incoming.requests-in.connector=smallrye-pulsar
   
   mp.messaging.outgoing.dump-out.topic=persistent://public/default/dump
   mp.messaging.outgoing.dump-out.connector=smallrye-pulsar
   mp.messaging.outgoing.dump-out.blockIfQueueFull=true
   mp.messaging.outgoing.dump-out.maxPendingMessages=8
   mp.messaging.outgoing.dump-out.maxPendingMessagesAcrossPartitions=12
   ```
   
   The retention of the topic `requests` is set using Pulsar Admin in Java to -1 -1.
   
   During two runs the consumer get stucked:
   <img width="1013" alt="Screenshot 2023-10-02 at 21 12 42" src="https://github.com/apache/pulsar/assets/4356553/b31bb39c-1491-4852-8eb6-a975155f31b2">
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-2098200276

   I could not reproduce the issue with 3.0.4, I can still reproduce the issue with 3.2.2
   @codelipenghui the hprof is here: https://github.com/michalcukierman/pulsar-21104/blob/main/heap.hprof
   It was taken on the execution of the code that is currently in the `main` branch (Pulsar 3.1.0 / Pulsar Client 3.2.2)


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "michalcukierman (via GitHub)" <gi...@apache.org>.
michalcukierman commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-2098254335

   
   https://github.com/apache/pulsar/assets/4356553/a8a9ef21-f12d-4d4d-97b5-9c1b028f4d8f
   https://github.com/apache/pulsar/assets/4356553/a104c3fe-ad46-4b48-82c2-e045e15b7ac4
   Comparison of 3.2.2 and 3.0.4
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "dao-jun (via GitHub)" <gi...@apache.org>.
dao-jun commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-2143017581

   @michalcukierman I'm not familiar with this kind of development framework, https://github.com/apache/pulsar/issues/21104#issuecomment-2140860378 is based on the stats and internal-stats you provided. The point is: all the messages dispatched to clients are not acked.
   
   You can debug your code to confirm the messages are acked or not


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [I] [Bug] Client with shared subscription is blocked [pulsar]

Posted by "jujiale (via GitHub)" <gi...@apache.org>.
jujiale commented on issue #21104:
URL: https://github.com/apache/pulsar/issues/21104#issuecomment-2866883104

   I guess we suffered the same problem. in issue #https://github.com/apache/pulsar/issues/24231, I also think it may occurs because   of deadlock.


-- 
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: commits-unsubscribe@pulsar.apache.org

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