question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Producer connection auto-closes after unspecified timeout

See original GitHub issue

Describe 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
alexyanscommented, Jun 3, 2021

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?

0reactions
alexyanscommented, Jun 3, 2021

Oh, good! Glad you worked it out then 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Reasons Why Connections Stay Open for a Long ...
If the value is 0, then close has been called by the application. If the value is 1 or higher, the application has...
Read more >
Kafka 3.3 Documentation
When a new event is published to a topic, it is actually appended to one of the topic's partitions. Events with the same...
Read more >
Kafka Broker Configurations for Confluent Platform
Offset commit will be delayed until all replicas for the offsets topic receive the commit or this timeout is reached. This is similar...
Read more >
All configuration options - Quarkus
AWS Lambda Type Default AWS Lambda Common Type Default AWS Lambda Gateway REST API Type Default Agroal ‑ Database connection pool Type Default
Read more >
Consumers - RabbitMQ
Client can lose their connection to RabbitMQ. When connection loss is detected, message delivery stops. Some client libraries offer automatic connection ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found