Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Conversation

jkodumal
Copy link
Contributor

No description provided.

private final JedisPoolConfig getPoolConfig() {
JedisPoolConfig config = new JedisPoolConfig();
config.setMaxTotal(256);
config.setBlockWhenExhausted(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the nature of the store abstraction, blocking when exhausted can cause a deadlock. This can happen because a single toggle call can require multiple jedis pool connections to complete-- one to check whether the store is initialized, and another to fetch the value from the store. If multiple threads attempt to do this concurrently, and the pool is near exhaustion, they could all acquire connections to check initialization, and then block waiting for another connection to fetch the store value.

@drichelson
Copy link
Contributor

LGTM

jkodumal added a commit that referenced this pull request Feb 15, 2016
@jkodumal jkodumal merged commit d514e6b into master Feb 15, 2016
@jkodumal jkodumal deleted the jko/fix-jedis-race branch February 15, 2016 15:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants