Jedis cluster pipeline sync problem #2991
-
I am experimenting with the new cluster pipeline support in jedis. Here is a sample script in scala val jedisClientConfig: DefaultJedisClientConfig = DefaultJedisClientConfig.builder().build()
val clusterConnectionProvider = new ClusterConnectionProvider(
Set(
new HostAndPort("h1", 1234),
new HostAndPort("h2", 5678)
).asJava, jedisClientConfig)
var pipeline = new ClusterPipeline(clusterConnectionProvider) As I am not using any pool I guess it is taking the default pool of size 8. I am syncing the pipeline after 10 commands. pipeline.sync()
pipeline = new ClusterPipeline(clusterConnectionProvider) After 80 commands, I guess the pool is exhausted and code freezes to move further. What is the best approach to handle such scenarios. Do I need to use
Please let me know what would be the ideal approach here. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
close()
ClusterPipeline aftersync()
. It'll release the resources (connections) it was using.