-
Notifications
You must be signed in to change notification settings - Fork 348
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
[BUG] AsyncRedisCluster keep cost fd at idle state #559
Comments
Update Due to Redis cluster passwd required, I didn't set it to cluster client. But, in the product env, can I know why so many fd since no traffic? |
One more question. // Create an AsyncRedis object with hash-tag, so that we can send commands that has no key.// It connects to Redis instance that holds the given key, i.e. hash-tag. Future ping_res = r.command("ping"); |
Once you create an AsyncRedisCluster object, it tries to connect to a random cluster node, and fetch the slot-node mapping. If it fails, it retries serval times (on other random nodes). Then it sleeps 1 second, and retry fetching the map. In your case, you set a wrong password, redis-plus-plus always fails to get the slot-node mapping, and closes the connections. That's why you see so many connections.
Once you send any command to Redis with AsyncRedisCluster, you'll get an exception that password is wrong. And you can handle the error.
Do you mean, you create an AsyncRedisCluster object with incorrect password, and the ping command throws "connection is closing" exception? I cannot reproduce your problem with the latest code on master. But if I remember correctly, I fixed a similar problem, and you can try if the latest code works well for you. Regards |
hi, Yes, I try to use ping to understand the rainy day case, and expected "NOAUTH Authentication required" to take action and prevent fd costing. But after I set correct password to AsyncRedisCluster, and send ping. Here is my output for set command and ping. It can prove async cluster is normal, while, ping can't work. Is there misusage in my ping? |
If wrong passwd to AsyncRedisCluster, the test result as below send set |
Have you waited the returned future before destroying the AsyncRedisCluster object? You need to ensure that all commands have been sent and the replies have been received before AsyncRedisCluster is destroyed. Otherwise, when AsyncRedisCluster is destructing, it closes the connection and mark all pending reply as error, i.e. connection is closing. Regards |
Describe the bug
After new AsyncRedisCluster client, and keep it idle, not send any traffic, I observed the fd keep costing.
To Reproduce
Minimal code to reproduce the bug.
client = new AsyncRedisCluster(connection_options, pool_options);
Then, sleep, without any traffic.
Expected behavior
Discovery cluster node status, and set up one connection to each node. Keep ESTABLISHED status.
Environment:
Additional context
Please provide solution and info for why AsyncRedisCluster keep cost fd after just created, and no traffic drop in.
The text was updated successfully, but these errors were encountered: