shustsud opened a new issue, #324: URL: https://github.com/apache/pulsar-client-cpp/issues/324
### Search before asking - [X] I searched in the [issues](https://github.com/apache/pulsar-client-cpp/issues) and found nothing similar. ### Version commit id: [b35ae1aa](https://github.com/apache/pulsar-client-cpp/commit/b35ae1aa4b9834886c0889635de81834f9b2f774) and [af45a54c](https://github.com/apache/pulsar-client-cpp/commit/af45a54c10ec5b06e80b683010afd3531457ac64) ### Minimal reproduce step step1: Create a partitioned topic.(In my environment, 16 partitions are used.) step2: Many Consumers connect to partitioned topic.(In my environment, 200 Consumers connected to partitioned topic.) Each Consumer connects to a different subscription. step3: Repeat Broker restart until segmentation fault occurs. ### What did you expect to see? Consumer reconnection succeeds. ### What did you see instead? Segmentation fault occurs. ### Anything else? This issue did not occur in [84ac6fb9](https://github.com/apache/pulsar-client-cpp/commit/84ac6fb912925a1c328ef06da2cc1f96803f15bc). Perhaps one of the commits between [787bfd0e](https://github.com/apache/pulsar-client-cpp/commit/787bfd0e450427ff753f6a54b63f7fe18a684529) and [b35ae1aa](https://github.com/apache/pulsar-client-cpp/commit/b35ae1aa4b9834886c0889635de81834f9b2f774) caused this issue. Client logs are as follows. ``` 2023-10-05 09:03:17.711 INFO [140211864341184] Client:90 | Subscribing on Topic :persistent://shustsud-test2/test/partitioned-topic 2023-10-05 09:03:17.711 INFO [140211864341184] ClientConnection:187 | [<none> -> pulsar+ssl://<host(vip)>:<prot>] Create ClientConnection, timeout=10000 2023-10-05 09:03:17.721 INFO [140211864341184] ConnectionPool:107 | Created connection for pulsar+ssl://<host(vip)>:<prot> 2023-10-05 09:03:17.726 INFO [140211814409984] ClientConnection:397 | [<host(client)>:44036 -> <host(vip)>:<prot>] Connected to broker 2023-10-05 09:03:17.756 INFO [140211814409984] HandlerBase:80 | [0x7f8594000ed0, dummy_18, 0] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f859402a240, dummy_18, 1] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f8594017d40, dummy_18, 2] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f8594035920, dummy_18, 3] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f8594017870, dummy_18, 4] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f85940476b0, dummy_18, 5] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f85940125b0, dummy_18, 6] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f8594053430, dummy_18, 7] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f85940594b0, dummy_18, 8] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f859405f480, dummy_18, 9] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f8594065450, dummy_18, 10] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f859406b210, dummy_18, 11] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f8594071250, dummy_18, 12] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f8594077220, dummy_18, 13] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f859407cfe0, dummy_18, 14] Getting connection from pool 2023-10-05 09:03:17.757 INFO [140211814409984] HandlerBase:80 | [0x7f8594057f20, dummy_18, 15] Getting connection from pool 2023-10-05 09:03:17.758 INFO [140211814409984] ClientConnection:187 | [<none> -> pulsar+ssl://<host(broker2)>:<prot>] Create ClientConnection, timeout=10000 2023-10-05 09:03:17.766 INFO [140211814409984] ConnectionPool:107 | Created connection for pulsar+ssl://<host(broker2)>:<prot> 2023-10-05 09:03:17.767 INFO [140211814409984] ClientConnection:397 | [<host(client)>:49870 -> <host(broker2)>:<prot>] Connected to broker 2023-10-05 09:03:17.772 INFO [140211814409984] ConsumerImpl:282 | [0x7f8594000ed0, dummy_18, 0] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.772 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 15 2023-10-05 09:03:17.772 INFO [140211814409984] ConsumerImpl:282 | [0x7f859402a240, dummy_18, 1] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.772 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 14 2023-10-05 09:03:17.772 INFO [140211814409984] ConsumerImpl:282 | [0x7f8594017d40, dummy_18, 2] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.772 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 13 2023-10-05 09:03:17.773 INFO [140211814409984] ConsumerImpl:282 | [0x7f8594035920, dummy_18, 3] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.773 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 12 2023-10-05 09:03:17.773 INFO [140211814409984] ConsumerImpl:282 | [0x7f8594017870, dummy_18, 4] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.773 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 11 2023-10-05 09:03:17.773 INFO [140211814409984] ConsumerImpl:282 | [0x7f85940476b0, dummy_18, 5] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.773 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 10 2023-10-05 09:03:17.773 INFO [140211814409984] ConsumerImpl:282 | [0x7f85940125b0, dummy_18, 6] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.773 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 9 2023-10-05 09:03:17.773 INFO [140211814409984] ConsumerImpl:282 | [0x7f8594053430, dummy_18, 7] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.773 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 8 2023-10-05 09:03:17.773 INFO [140211814409984] ConsumerImpl:282 | [0x7f85940594b0, dummy_18, 8] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.773 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 7 2023-10-05 09:03:17.774 INFO [140211814409984] ConsumerImpl:282 | [0x7f859405f480, dummy_18, 9] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.774 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 6 2023-10-05 09:03:17.774 INFO [140211814409984] ConsumerImpl:282 | [0x7f8594065450, dummy_18, 10] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.774 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 5 2023-10-05 09:03:17.774 INFO [140211814409984] ConsumerImpl:282 | [0x7f859406b210, dummy_18, 11] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.774 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 4 2023-10-05 09:03:17.774 INFO [140211814409984] ConsumerImpl:282 | [0x7f8594071250, dummy_18, 12] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.774 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 3 2023-10-05 09:03:17.774 INFO [140211814409984] ConsumerImpl:282 | [0x7f8594077220, dummy_18, 13] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.774 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 2 2023-10-05 09:03:17.775 INFO [140211814409984] ConsumerImpl:282 | [0x7f859407cfe0, dummy_18, 14] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.775 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 1 2023-10-05 09:03:17.775 INFO [140211814409984] ConsumerImpl:282 | [0x7f8594057f20, dummy_18, 15] Created consumer on broker [<host(client)>:49870 -> <host(broker2)>:<prot>] 2023-10-05 09:03:17.775 INFO [140211814409984] MultiTopicsConsumerImpl:303 | Successfully Subscribed to a single partition of topic in TopicsConsumer. Partitions need to create : 0 2023-10-05 09:03:17.775 INFO [140211814409984] MultiTopicsConsumerImpl:146 | Successfully Subscribed to Topics 2023-10-05 09:06:56.935 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 12 2023-10-05 09:06:56.935 INFO [140211814409984] HandlerBase:140 | [0x7f8594071250, dummy_18, 12] Schedule reconnection in 0.1 s 2023-10-05 09:06:56.960 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 4 2023-10-05 09:06:56.960 INFO [140211814409984] HandlerBase:140 | [0x7f8594017870, dummy_18, 4] Schedule reconnection in 0.1 s 2023-10-05 09:06:56.986 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 8 2023-10-05 09:06:56.986 INFO [140211814409984] HandlerBase:140 | [0x7f85940594b0, dummy_18, 8] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.011 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 0 2023-10-05 09:06:57.011 INFO [140211814409984] HandlerBase:140 | [0x7f8594000ed0, dummy_18, 0] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.209 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 7 2023-10-05 09:06:57.209 INFO [140211814409984] HandlerBase:140 | [0x7f8594053430, dummy_18, 7] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.209 INFO [140211814409984] HandlerBase:80 | [0x7f8594071250, dummy_18, 12] Getting connection from pool 2023-10-05 09:06:57.209 INFO [140211814409984] HandlerBase:80 | [0x7f8594017870, dummy_18, 4] Getting connection from pool 2023-10-05 09:06:57.209 INFO [140211814409984] HandlerBase:80 | [0x7f85940594b0, dummy_18, 8] Getting connection from pool 2023-10-05 09:06:57.209 INFO [140211814409984] HandlerBase:80 | [0x7f8594000ed0, dummy_18, 0] Getting connection from pool 2023-10-05 09:06:57.209 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 11 2023-10-05 09:06:57.209 INFO [140211814409984] HandlerBase:140 | [0x7f859406b210, dummy_18, 11] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.209 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 15 2023-10-05 09:06:57.209 INFO [140211814409984] HandlerBase:140 | [0x7f8594057f20, dummy_18, 15] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.209 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 3 2023-10-05 09:06:57.209 INFO [140211814409984] HandlerBase:140 | [0x7f8594035920, dummy_18, 3] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.209 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 10 2023-10-05 09:06:57.209 INFO [140211814409984] HandlerBase:140 | [0x7f8594065450, dummy_18, 10] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.209 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 2 2023-10-05 09:06:57.209 INFO [140211814409984] HandlerBase:140 | [0x7f8594017d40, dummy_18, 2] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.209 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 14 2023-10-05 09:06:57.210 INFO [140211814409984] HandlerBase:140 | [0x7f859407cfe0, dummy_18, 14] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.210 INFO [140211814409984] ClientConnection:187 | [<none> -> pulsar+ssl://<host(broker1)>:<prot>] Create ClientConnection, timeout=10000 2023-10-05 09:06:57.616 INFO [140211814409984] ConnectionPool:107 | Created connection for pulsar+ssl://<host(broker1)>:<prot> 2023-10-05 09:06:57.616 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 6 2023-10-05 09:06:57.616 INFO [140211814409984] HandlerBase:140 | [0x7f85940125b0, dummy_18, 6] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.616 INFO [140211814409984] HandlerBase:80 | [0x7f8594053430, dummy_18, 7] Getting connection from pool 2023-10-05 09:06:57.616 INFO [140211814409984] HandlerBase:80 | [0x7f859406b210, dummy_18, 11] Getting connection from pool 2023-10-05 09:06:57.616 INFO [140211814409984] HandlerBase:80 | [0x7f8594057f20, dummy_18, 15] Getting connection from pool 2023-10-05 09:06:57.616 INFO [140211814409984] HandlerBase:80 | [0x7f8594035920, dummy_18, 3] Getting connection from pool 2023-10-05 09:06:57.617 INFO [140211814409984] HandlerBase:80 | [0x7f8594065450, dummy_18, 10] Getting connection from pool 2023-10-05 09:06:57.617 INFO [140211814409984] HandlerBase:80 | [0x7f8594017d40, dummy_18, 2] Getting connection from pool 2023-10-05 09:06:57.617 INFO [140211814409984] HandlerBase:80 | [0x7f859407cfe0, dummy_18, 14] Getting connection from pool 2023-10-05 09:06:57.617 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 5 2023-10-05 09:06:57.617 INFO [140211814409984] HandlerBase:140 | [0x7f85940476b0, dummy_18, 5] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.617 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 13 2023-10-05 09:06:57.617 INFO [140211814409984] HandlerBase:140 | [0x7f8594077220, dummy_18, 13] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.617 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 9 2023-10-05 09:06:57.617 INFO [140211814409984] HandlerBase:140 | [0x7f859405f480, dummy_18, 9] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.617 INFO [140211814409984] ConsumerImpl:1207 | Broker notification of Closed consumer: 1 2023-10-05 09:06:57.617 INFO [140211814409984] HandlerBase:140 | [0x7f859402a240, dummy_18, 1] Schedule reconnection in 0.1 s 2023-10-05 09:06:57.617 INFO [140211814409984] ClientConnection:397 | [<host(client)>:49194 -> <host(broker1)>:<prot>] Connected to broker 2023-10-05 09:06:57.617 ERROR [140211814409984] ClientConnection:1330 | [<host(client)>:49870 -> <host(broker2)>:<prot>] Connection closed with ConnectError 2023-10-05 09:06:57.617 INFO [140211814409984] ConnectionPool:122 | Remove connection for pulsar+ssl://<host(broker2)>:<prot> 2023-10-05 09:06:57.617 INFO [140211814409984] ClientConnection:267 | [<host(client)>:49870 -> <host(broker2)>:<prot>] Destroyed connection to pulsar+ssl://<host(broker2)>:<prot> 2023-10-05 09:06:57.618 WARN [140211814409984] ClientConnection:1135 | [<host(client)>:44036 -> <host(vip)>:<prot>] Could not send message on connection: system:32 Broken pipe 2023-10-05 09:06:57.619 ERROR [140211814409984] ClientConnection:1330 | [<host(client)>:44036 -> <host(vip)>:<prot>] Connection closed with ConnectError 2023-10-05 09:06:57.619 INFO [140211814409984] ConnectionPool:122 | Remove connection for pulsar+ssl://<host(vip)>:<prot> 2023-10-05 09:06:57.619 ERROR [140211814409984] BinaryProtoLookupService:68 | Lookup failed for persistent://shustsud-test2/test/partitioned-topic-partition-7, result ConnectError 2023-10-05 09:06:57.619 INFO [140211814409984] HandlerBase:140 | [0x7f8594053430, dummy_18, 7] Schedule reconnection in 0.196 s 2023-10-05 09:06:57.619 ERROR [140211814409984] BinaryProtoLookupService:68 | Lookup failed for persistent://shustsud-test2/test/partitioned-topic-partition-11, result ConnectError 2023-10-05 09:06:57.619 INFO [140211814409984] HandlerBase:140 | [0x7f859406b210, dummy_18, 11] Schedule reconnection in 0.196 s 2023-10-05 09:06:57.619 ERROR [140211814409984] BinaryProtoLookupService:68 | Lookup failed for persistent://shustsud-test2/test/partitioned-topic-partition-15, result ConnectError 2023-10-05 09:06:57.619 INFO [140211814409984] HandlerBase:140 | [0x7f8594057f20, dummy_18, 15] Schedule reconnection in 0.196 s 2023-10-05 09:06:57.619 ERROR [140211814409984] BinaryProtoLookupService:68 | Lookup failed for persistent://shustsud-test2/test/partitioned-topic-partition-3, result ConnectError 2023-10-05 09:06:57.619 INFO [140211814409984] HandlerBase:140 | [0x7f8594035920, dummy_18, 3] Schedule reconnection in 0.196 s 2023-10-05 09:06:57.619 ERROR [140211814409984] BinaryProtoLookupService:68 | Lookup failed for persistent://shustsud-test2/test/partitioned-topic-partition-10, result ConnectError 2023-10-05 09:06:57.619 INFO [140211814409984] HandlerBase:140 | [0x7f8594065450, dummy_18, 10] Schedule reconnection in 0.196 s 2023-10-05 09:06:57.619 ERROR [140211814409984] BinaryProtoLookupService:68 | Lookup failed for persistent://shustsud-test2/test/partitioned-topic-partition-2, result ConnectError 2023-10-05 09:06:57.619 INFO [140211814409984] HandlerBase:140 | [0x7f8594017d40, dummy_18, 2] Schedule reconnection in 0.196 s 2023-10-05 09:06:57.619 ERROR [140211814409984] BinaryProtoLookupService:68 | Lookup failed for persistent://shustsud-test2/test/partitioned-topic-partition-14, result ConnectError 2023-10-05 09:06:57.619 INFO [140211814409984] HandlerBase:140 | [0x7f859407cfe0, dummy_18, 14] Schedule reconnection in 0.196 s 2023-10-05 09:06:57.619 INFO [140211814409984] ClientConnection:267 | [<host(client)>:44036 -> <host(vip)>:<prot>] Destroyed connection to pulsar+ssl://<host(vip)>:<prot> Segmentation fault ``` ### 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
