liudezhi2098 opened a new issue, #15319:
URL: https://github.com/apache/pulsar/issues/15319
**Describe the bug**
If service_url is list, and first ip is an invalid, will fail to connect,
and will not choose other ip to try
`pulsar-client=2.9.1`
**To Reproduce**
```
import pulsar
service_url = 'pulsar://127.0.0.2:6650,127.0.0.1:6650'
client = pulsar.Client(service_url)
producer = client.create_producer('test')
```
error log
```
2022-04-26 09:17:30.921 INFO [0x11c8ade00] ClientConnection:182 | [<none>
-> pulsar://127.0.0.2:6650,127.0.0.1:6650] Create ClientConnection,
timeout=10000
2022-04-26 09:17:30.921 INFO [0x11c8ade00] ConnectionPool:96 | Created
connection for pulsar://127.0.0.2:6650,127.0.0.1:6650
2022-04-26 09:17:40.923 ERROR [0x70000ae45000] ClientConnection:547 |
[<none> -> pulsar://127.0.0.2:6650,127.0.0.1:6650] Connection was not
established in 10000 ms, close the socket
2022-04-26 09:17:40.923 WARN [0x70000ae45000] ClientConnection:429 |
[<none> -> pulsar://127.0.0.2:6650,127.0.0.1:6650] Failed to establish
connection: Operation canceled
2022-04-26 09:17:40.923 INFO [0x70000ae45000] ClientConnection:1523 |
[<none> -> pulsar://127.0.0.2:6650,127.0.0.1:6650] Connection closed
2022-04-26 09:17:40.923 ERROR [0x70000ae45000] ClientImpl:181 | Error
Checking/Getting Partition Metadata while creating producer on
persistent://public/default/test -- ConnectError
2022-04-26 09:17:40.923 INFO [0x70000ae45000] ClientConnection:256 |
[<none> -> pulsar://127.0.0.2:6650,127.0.0.1:6650] Destroyed connection
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pulsar/__init__.py",
line 603, in create_producer
p._producer = self._client.create_producer(topic, conf)
_pulsar.ConnectError: Pulsar error: ConnectError
```
**Expected behavior**
`sh pulsar-client --url pulsar://127.0.0.2:6650,127.0.0.1:6650 produce
-m 'test' -n 1 topic`
`[main] INFO org.apache.pulsar.client.cli.PulsarClientTool - 1 messages
successfully produced`
--
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]