BewareMyPower opened a new issue, #436:
URL: https://github.com/apache/pulsar-client-cpp/issues/436

   ### Search before asking
   
   - [X] I searched in the 
[issues](https://github.com/apache/pulsar-client-cpp/issues) and found nothing 
similar.
   
   
   ### Version
   
   Based on 35bf161ba25c9ea073b730e3dcdaa50c30703bcb
   
   ### Minimal reproduce step
   
   Apply the following patch and run the `SampleConsumer` against a standalone 
and a partitioned topic `output` with 1 partition.
   
   ### What did you expect to see?
   
   The consumer should reconnect successfully.
   
   ### What did you see instead?
   
   Outputs:
   
   ```
   2024-07-19 20:47:18.012 INFO  [0x1e7542100] Client:86 | Subscribing on Topic 
:output
   2024-07-19 20:47:18.013 INFO  [0x1e7542100] ClientConnection:188 | [<none> 
-> pulsar://localhost:6650] Create ClientConnection, timeout=10000
   2024-07-19 20:47:18.013 INFO  [0x1e7542100] ConnectionPool:124 | Created 
connection for pulsar://localhost:6650-pulsar://localhost:6650-0
   2024-07-19 20:47:18.014 INFO  [0x16de47000] ClientConnection:405 | 
[127.0.0.1:60869 -> 127.0.0.1:6650] Connected to broker
   2024-07-19 20:47:18.077 INFO  [0x16de47000] HandlerBase:111 | 
[persistent://public/default/output-partition-0, sub, 0] Getting connection 
from pool
   2024-07-19 20:47:18.200 INFO  [0x16de47000] BinaryProtoLookupService:86 | 
Lookup response for persistent://public/default/output-partition-0, 
lookup-broker-url pulsar://localhost:6650, from [127.0.0.1:60869 -> 
127.0.0.1:6650] 
   2024-07-19 20:47:18.645 INFO  [0x16de47000] ConsumerImpl:300 | 
[persistent://public/default/output-partition-0, sub, 0] Created consumer on 
broker [127.0.0.1:60869 -> 127.0.0.1:6650] 
   2024-07-19 20:47:18.645 INFO  [0x16de47000] MultiTopicsConsumerImpl:308 | 
Successfully Subscribed to a single partition of topic in TopicsConsumer. 
Partitions need to create : 0
   2024-07-19 20:47:18.645 INFO  [0x16de47000] MultiTopicsConsumerImpl:150 | 
Successfully Subscribed to Topics
   2024-07-19 20:47:48.037 INFO  [0x16de47000] ClientConnection:1299 | 
[127.0.0.1:60869 -> 127.0.0.1:6650] Connection disconnected (refCnt: 3)
   2024-07-19 20:47:48.037 INFO  [0x16de47000] ConnectionPool:141 | Remove 
connection for pulsar://localhost:6650-pulsar://localhost:6650-0
   2024-07-19 20:47:48.038 INFO  [0x16de47000] HandlerBase:178 | 
[persistent://public/default/output-partition-0, sub, 0] Schedule reconnection 
in 0.1 s
   2024-07-19 20:47:48.038 INFO  [0x16de47000] ClientConnection:277 | 
[127.0.0.1:60869 -> 127.0.0.1:6650] Destroyed connection to 
pulsar://localhost:6650-0
   2024-07-19 20:48:18.647 INFO  [0x16df5f000] ClientConnection:188 | [<none> 
-> pulsar://localhost:6650] Create ClientConnection, timeout=10000
   2024-07-19 20:48:18.647 INFO  [0x16df5f000] ConnectionPool:124 | Created 
connection for pulsar://localhost:6650-pulsar://localhost:6650-0
   2024-07-19 20:48:18.650 INFO  [0x16de47000] ClientConnection:405 | 
[127.0.0.1:60901 -> 127.0.0.1:6650] Connected to broker
   2024-07-19 20:48:48.658 INFO  [0x16de47000] ClientConnection:1299 | 
[127.0.0.1:60901 -> 127.0.0.1:6650] Connection disconnected (refCnt: 3)
   2024-07-19 20:48:48.659 INFO  [0x16de47000] ConnectionPool:141 | Remove 
connection for pulsar://localhost:6650-pulsar://localhost:6650-0
   2024-07-19 20:48:48.661 INFO  [0x16de47000] ClientConnection:277 | 
[127.0.0.1:60901 -> 127.0.0.1:6650] Destroyed connection to 
pulsar://localhost:6650-0
   ```
   
   The topic stats:
   
   ```json
     "subscriptions" : {
       "sub" : {
         "msgRateOut" : 0.0,
         "msgThroughputOut" : 0.0,
         "bytesOutCounter" : 0,
         "msgOutCounter" : 0,
         "msgRateRedeliver" : 0.0,
         "messageAckRate" : 0.0,
         "chunkedMessageRate" : 0.0,
         "msgBacklog" : 0,
         "backlogSize" : 0,
         "earliestMsgPublishTimeInBacklog" : 0,
         "msgBacklogNoDelayed" : 0,
         "blockedSubscriptionOnUnackedMsgs" : false,
         "msgDelayed" : 0,
         "unackedMessages" : 0,
         "type" : "Exclusive",
         "msgRateExpired" : 0.0,
         "totalMsgExpired" : 0,
         "lastExpireTimestamp" : 0,
         "lastConsumedFlowTimestamp" : 1721393238646,
         "lastConsumedTimestamp" : 0,
         "lastAckedTimestamp" : 0,
         "lastMarkDeleteAdvancedTimestamp" : 0,
         "consumers" : [ ],
         "isDurable" : true,
         "isReplicated" : false,
         "allowOutOfOrderDelivery" : false,
         "consumersAfterMarkDeletePosition" : { },
         "nonContiguousDeletedMessagesRanges" : 0,
         "nonContiguousDeletedMessagesRangesSerializedSize" : 0,
         "delayedMessageIndexSizeInBytes" : 0,
         "subscriptionProperties" : { },
         "filterProcessedMsgCount" : 0,
         "filterAcceptedMsgCount" : 0,
         "filterRejectedMsgCount" : 0,
         "filterRescheduledMsgCount" : 0,
         "durable" : true,
         "replicated" : false
       }
     },
   ```
   
   As you can see, the "consumers" list is empty.
   
   ### Anything else?
   
   I tried unloading the namespace:
   
   ```bash
   ./bin/pulsar-admin topics stats output-partition-0 
   ```
   
   The client didn't schedule reconnection
   
   ```bash
   2024-07-19 20:49:18.654 INFO  [0x16df5f000] ClientConnection:188 | [<none> 
-> pulsar://localhost:6650] Create ClientConnection, timeout=10000
   2024-07-19 20:49:18.654 INFO  [0x16df5f000] ConnectionPool:124 | Created 
connection for pulsar://localhost:6650-pulsar://localhost:6650-0
   2024-07-19 20:49:18.656 INFO  [0x16de47000] ClientConnection:405 | 
[127.0.0.1:60924 -> 127.0.0.1:6650] Connected to broker
   ```
   
   The stats became:
   
   ```json
     "subscriptions" : {
       "sub" : {
         "msgRateOut" : 0.0,
         "msgThroughputOut" : 0.0,
         "bytesOutCounter" : 0,
         "msgOutCounter" : 0,
         "msgRateRedeliver" : 0.0,
         "messageAckRate" : 0.0,
         "chunkedMessageRate" : 0.0,
         "msgBacklog" : 0,
         "backlogSize" : 0,
         "earliestMsgPublishTimeInBacklog" : 0,
         "msgBacklogNoDelayed" : 0,
         "blockedSubscriptionOnUnackedMsgs" : false,
         "msgDelayed" : 0,
         "unackedMessages" : 0,
         "type" : "None",
         "msgRateExpired" : 0.0,
         "totalMsgExpired" : 0,
         "lastExpireTimestamp" : 0,
         "lastConsumedFlowTimestamp" : 0,
         "lastConsumedTimestamp" : 0,
         "lastAckedTimestamp" : 0,
         "lastMarkDeleteAdvancedTimestamp" : 0,
         "consumers" : [ ],
         "isDurable" : true,
         "isReplicated" : false,
         "allowOutOfOrderDelivery" : false,
         "consumersAfterMarkDeletePosition" : { },
         "nonContiguousDeletedMessagesRanges" : 0,
         "nonContiguousDeletedMessagesRangesSerializedSize" : 0,
         "delayedMessageIndexSizeInBytes" : 0,
         "subscriptionProperties" : { },
         "filterProcessedMsgCount" : 0,
         "filterAcceptedMsgCount" : 0,
         "filterRejectedMsgCount" : 0,
         "filterRescheduledMsgCount" : 0,
         "replicated" : false,
         "durable" : true
       }
     },
   ```
   
   The "consumers" list was still empty and the subscription type became "None" 
now.
   
   ### Are you willing to submit a PR?
   
   - [X] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to