added limit on how long client pool can be exhausted #633

merged 12 commits into from Sep 6, 2013


None yet
2 participants

shaunkalley commented Sep 5, 2013

Added a new pool metric, getExhaustedTime(), and a new configuration property, maxExhaustedTimeBeforeSuspending, which are used to decide, when an HPoolExhaustedException is caught in HConnectionManager, whether the host should be marked as down or not.

I don't think a thread barrier is necessary - particularly that you are setting the start time to an explicit value. Whereas if these values had to be kept in sync, then maybe.


shaunkalley replied Sep 6, 2013

I do think the two properties need to be tracked together since the definition of exhaustion is when the realActiveClientsCount reaches maxActive. Hence the time when exhaustion starts needs to be tracked atomically with that property.


shaunkalley commented Sep 6, 2013

Sorry for the extra commits, Nate; I'm still a little new to the GitHub way of doing things. But I realized that I hadn't added a test case for this change (and I'm glad I added it because it showed an error in the value I assigned to CassandraHost.DEFAULT_MAX_EXHAUSTED_TIME_BEFORE_SUSPENDING). I also thought that reaching the exhausted time limit was significant enough to warrant a log message after attempting to suspend the pool.

And I think you're probably right about the synchronized block so I've removed it.


zznate commented Sep 6, 2013

No worries. This looks good, but it needs to be rebased from master given the changes pulled in from yesterday.

shaunkalley and others added some commits Sep 6, 2013

Merge remote-tracking branch 'hector-origin/master' into ImprovedConn…


shaunkalley commented Sep 6, 2013

Its all been synced now.


zznate commented Sep 6, 2013

Super cool - thanks @shaunkalley

zznate added a commit that referenced this pull request Sep 6, 2013

Merge pull request #633 from shaunkalley/ImprovedConnectionManager
added limit on how long client pool can be exhausted

@zznate zznate merged commit 19d0a0b into hector-client:master Sep 6, 2013

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