-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCP socket opened leak using proxy #472
Comments
I'm currently running 1 client with one producer and one consumer without sending or receiving messages. They are just connected and receiving/replying to broker's ping. With the Go client:
With the Java client:
|
@KannarFr thanks for your brief description, would you mind to share some proxy's full logs for above tests with go client & java client? |
For java:
Stable no more connections, it should be only one as mentioned in the pulsar documentation but there are 4. For go:
Still having new connection |
@KannarFr thanks for your inputs, I have to setup some test envs to debug with this issue. Will let you know if I have any updates. |
@KannarFr I have compared go client and java client, one difference is go client send |
Fixes #472 ### Motivation #472 addressed a socket leakage in go client. with some debug works, a difference between java client and go client was found. one difference is go client send `PartitionedTopicMetadata` request with new connection, but java is using lookup service's connection. This pr added `GetPartitionedTopicMetadata` to lookup service to reuse the lookup service connection. Through this pr, the leakage has been resolved with [this sample deployment](https://gist.github.com/freeznet/8681525ddd240877af88633363ba222f), the sockets are keep to 7 for 2 hours test. But still need to check with @KannarFr to see if there are any other possible leakages since I cannot have a cluster with 20 proxies/20 brokers/7 ZK locally.
Expected behavior
When a client is connected, the proxy shouldn't continue to create a connection with the broker.
Actual behavior
Considering a client with one producer and one consumer,
A cluster with 20 proxies/20 brokers/7 ZK
With 500 clients
With 300k clients
Using go client,
The proxies continue to create connections indefinitely to brokers.
Then it conducts the proxies nodes to use all socket the host could provide.
Then, the proxy becomes unable and another gets the same problem, etc.
Finally, the cluster becomes fully unreachable.
Notes
There is no debug logs from go client that it's reconnecting or something.
For each new TCP socket opened, a connection from proxy to broker is logged.
Steps to reproduce
Create 500 clients using go client, for each creates a producer and a consumer to cluster with multiples proxies/brokers and follow the number of opened TCP connections on proxy using:
The text was updated successfully, but these errors were encountered: