Skip to content

Commit

Permalink
Merge pull request #447 from mattrjacobs/fix-sync-queue
Browse files Browse the repository at this point in the history
Fixed HystrixThreadPool to always return true for isQueueSpaceAvailable() when size = 0 (the SynchronousQueue case)
  • Loading branch information
mattrjacobs committed Jan 6, 2015
2 parents 2c4a01c + 07d30ab commit 1a23f15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ public void markThreadCompletion() {
/**
* Whether the threadpool queue has space available according to the <code>queueSizeRejectionThreshold</code> settings.
* <p>
* If a SynchronousQueue implementation is used (<code>maxQueueSize</code> == -1), it always returns 0 as the size so this would always return true.
* If a SynchronousQueue implementation is used (<code>maxQueueSize</code> <= 0), it always returns 0 as the size so this would always return true.
*/
@Override
public boolean isQueueSpaceAvailable() {
if (properties.maxQueueSize().get() < 0) {
if (properties.maxQueueSize().get() <= 0) {
// we don't have a queue so we won't look for space but instead
// let the thread-pool reject or not
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ public void run() {

@Override
public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) {
System.out.println("delayed scheduling");
throw new IllegalStateException("Hystrix does not support delayed scheduling");
}

Expand Down

0 comments on commit 1a23f15

Please sign in to comment.