Skip to content
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

Fix cluster reconnect example #292

Closed

Conversation

pendula95
Copy link
Member

@pendula95 pendula95 commented May 21, 2021

Motivation: Current example shows bad practice that can lead to dangling connections and concurrent issues.
It should tackle the issue mentioned #255

pendula95 and others added 30 commits May 21, 2021 13:06
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
…annotation

Add a missing Nullable annotation
Initial support for pool metrics
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Azure redis hello command is broken, we need to avoid it
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Do not reuse connections that enter pubsub mode
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
pmlopes and others added 25 commits October 8, 2021 13:54
…s empty

Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Update RedisExamples.java to add onFailure in createRedisClient
…ions are in use

Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
…' into fix-cluster-reconnect-example

# Conflicts:
#	src/main/java/examples/RedisExamples.java
@pmlopes
Copy link
Member

pmlopes commented Jan 17, 2022

I've cherry picked the commit to master as there's too much noise in the PR. The commit retains full attribution.

790475d

@pmlopes pmlopes closed this Jan 17, 2022
@koby08
Copy link

koby08 commented May 10, 2022

@pmlopes @pendula95 I believe that the fixed version of the example will still suffer from a connection leak. The code attempts to call close() on RedisConnection, which (if I recall correctly) doesn't close the connection pool. You have to call close() on the Redis itself (the one returned from createClient)

See #255

@pendula95
Copy link
Member Author

pendula95 commented May 10, 2022

I think you are right. Looking at my own implementations in projects I see I use ((RedisClusterConnection) redisConnection.getDelegate()).close(); which will call

The example should be changed to feature this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

7 participants