BewareMyPower commented on issue #10721:
URL: https://github.com/apache/pulsar/issues/10721#issuecomment-863847780
Okay, so the program stuck at `create_producer` for 5 minutes after all logs?
BTW, I suspect there's something wrong with the topics auto delete policy.
Could you modify your broker's config to the following config before re-testing?
```properties
brokerDeleteInactiveTopicsEnabled=false
```
I noticed that you created a producer of a partitioned topic that has 31
partitions, right?
```
2021-06-01 15:47:37.818 INFO [140607145748224] HandlerBase:54 |
[persistent://public/default/foobar-partition-0, ] Getting connection from pool
...
2021-06-01 15:47:37.818 INFO [140607145748224] HandlerBase:54 |
[persistent://public/default/foobar-partition-31, ] Getting connection from pool
```
It's a little weird that only 25 partitions were associated with producers
successfully but the producer still worked well before a broker was stopped.
```
2021-06-01 15:47:37.826 INFO [140607145748224] ProducerImpl:170 |
[persistent://public/default/foobar-partition-1, ] Created producer on broker
[10.0.181.183:40766 -> 10.0.177.109:6650]
# 23 lines...
2021-06-01 15:47:37.837 INFO [140607145748224] ProducerImpl:170 |
[persistent://public/default/foobar-partition-11, ] Created producer on broker
[10.0.181.183:55478 -> 10.0.185.97:6650]
```
The partitions are [0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 14, 16, 17, 18, 19,
20, 21, 22, 24, 25, 26, 28, 30, 31] after sorted. Then [13, 17, 21, 25, 28] of
them were not available and the client reconnect. Though these 5 partitions
were associated with producers eventually, the `create_producer` didn't return.
I'll take a further look at this issue. And when you're altering my code, if
you're going to recreate a producer, it's better to close the original producer
first. i.e.
```python
def run(self):
producer = self.get_producer()
# TODO: add your logic here
if (encounter_failure()):
producer.close()
producer = self.get_producer()
```
--
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:
[email protected]