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 2021/05/27 02:37:27 UTC

[GitHub] [pulsar] BewareMyPower commented on issue #10721: (2.7.1) Python client blocks forever in "create_producer" during a broker failure, even if "operation_timeout_seconds" is set

BewareMyPower commented on issue #10721:
URL: https://github.com/apache/pulsar/issues/10721#issuecomment-849272153


   `create_producer` will first connect to the URL's broker for topic lookup. Currently C++/Python client only supports a single broker's advertised address, which broker did you connect to in your 5 brokers? And was this broker still available? If the broker for topic lookup was not available, the client wouldn't switch to another broker and the `ConnectError` should be reported for `create_producer`.
   
   Could you collect and provide logs from a stuck producer?
   
   Here's the python code I guessed, could you point out some differences from your code?
   
   ```python
   import pulsar
   import _pulsar
   from pulsar.schema import *
   
   client = pulsar.Client(service_url='pulsar://localhost:6650', operation_timeout_seconds=5)
   producer = client.create_producer('my-topic', send_timeout_millis=1000, schema=StringSchema())
   
   for i in range(0, 10000000):
       try:
           producer.send(str(i))
       except _pulsar.Timeout as e:
           print('Failed to send {}: {}'.format(i, e))
           producer = client.create_producer('my-topic', send_timeout_millis=1000)
   
   client.close()
   ```


-- 
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