issue-650 DynamicLoadBalancingPolicy: LatencyAwareHClientPool may throw ... #651

Merged
merged 1 commit into from Jan 16, 2014

2 participants

@jsbret

...NoSuchElementException under certain circumstances

Using the poll() method of the LinkedBlockingDeque prevent
NoSuchElementException to be thrown in case the deque is cleared by the
DynamicLoadBalancingPolicy resetThread.

jsbret issue-650 DynamicLoadBalancingPolicy: LatencyAwareHClientPool may thr…
…ow NoSuchElementException under certain circumstances

Using the poll() method of the LinkedBlockingDeque prevent
NoSuchElementException throwing in case the deque is cleared by the
DynamicLoadBalancingPolicy resetThread.
07f271c
@zznate
Collaborator

Good catch. Do you think we would be in a situation where we would like to timeout? In otherwords, do you see a situation where poll() would block indefinitely?

@jsbret

This block of code is only called on client release after a successful operation in Cassandra (HConnectionManager line 312).The value return by poll() have no interest, we only need a method that make little space in the deque to store new value.

Thanks for your response ;-)

@zznate
Collaborator

Good point. Thanks!

@zznate zznate merged commit b7a7041 into hector-client:master Jan 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment