Producer connection auto-closes after unspecified timeout
See original GitHub issueDescribe the bug I came across this using the node client, but it appears to be a server issue. When I create a new producer, I can send messages successfully, which rules out TLS handshake problems. Connecting to pulsar appears to be okay.
If, however, the producer connection remains idle for about 200 milliseconds, I get the following console output (hosts and remote IPs omitted):
2020-03-05 10:17:12.571 INFO ConnectionPool:85 | Created connection for pulsar+ssl://<host omitted>
2020-03-05 10:17:12.700 INFO ClientConnection:330 | [172.19.0.2:36756 -> <IP omitted>:6651] Connected to broker
2020-03-05 10:17:12.825 INFO BatchMessageContainer:43 | { BatchContainer [size = 0] [batchSizeInBytes_ = 0] [maxAllowedMessageBatchSizeInBytes_ = 131072] [maxAllowedNumMessagesInBatch_ = 1000] [topicName = persistent://<omitted>/test-topic] [producerName_ = ] [batchSizeInBytes_ = 0] [numberOfBatchesSent = 0] [averageBatchSize = 0]} BatchMessageContainer constructed
2020-03-05 10:17:12.825 INFO HandlerBase:53 | [persistent://<omitted>/test-topic, ] Getting connection from pool
2020-03-05 10:17:12.852 INFO ConnectionPool:85 | Created connection for pulsar+ssl://192.168.125.165:6651
2020-03-05 10:17:12.878 INFO ClientConnection:332 | [172.19.0.2:36758 -> <IP omitted>:6651] Connected to broker through proxy. Logical broker: pulsar+ssl://192.168.125.165:6651
2020-03-05 10:17:12.993 INFO ProducerImpl:151 | [persistent://<omitted>/test-topic, ] Created producer on broker [172.19.0.2:36758 -> <IP omitted>:6651]
2020-03-05 10:17:13.093 INFO ClientConnection:1349 | [172.19.0.2:36758 -> <IP omitted>:6651] Connection closed
2020-03-05 10:17:13.093 INFO ClientConnection:1349 | [172.19.0.2:36756 -> <IP omitted>4:6651] Connection closed
2020-03-05 10:17:13.093 INFO ClientConnection:235 | [172.19.0.2:36758 -> <IP omitted>:6651] Destroyed connection
To Reproduce
- Create a producer from a client library
- Sleep and observe the console output
Expected behavior Connection should remain open, or if the timeout is intentional, it should be exposed as a config option
Desktop (please complete the following information):
- Debian GNU/Linux 9 (stretch)
Additional context Issue cannot be reproduced through the CLI client, because creating a producer connection is triggered by explicitly sending a message, which means the connection will never remain idle.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5
Top GitHub Comments
I don’t have access to the release version at the moment, but the bug was patched in the C++ client that other language-specific clients wrap around. That was about 9 months ago.
Perhaps the python lib needs to bump the dependency?
Oh, good! Glad you worked it out then 😃