Skip to content

Commit

Permalink
Adding comments to illustrate a problem
Browse files Browse the repository at this point in the history
No code change.
  • Loading branch information
arunthirupathi committed Sep 17, 2014
1 parent fb18c79 commit d34c946
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java
Expand Up @@ -57,7 +57,8 @@ public QueuedKeyedResourcePool(ResourceFactory<K, V> objectFactory, ResourcePool
}

/**
* Create a new queued pool with key type K, request type R, and value type V.
* Create a new queued pool with key type K, request type R, and value type
* V.
*
* @param factory The factory that creates objects
* @param config The pool config
Expand All @@ -69,8 +70,8 @@ public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V>
}

/**
* Create a new queued pool using the defaults for key of tyep K,
* request of type R, and value of Type V.
* Create a new queued pool using the defaults for key of tyep K, request of
* type R, and value of Type V.
*
* @param factory The factory that creates objects
* @return The created pool
Expand Down Expand Up @@ -187,6 +188,16 @@ private boolean processQueue(K key) {
}

/**
* TODO: The processQueueLoop is typically invoked from the selector (
* serial could invoke this as well, but most likely Parallel (Selector
* returning connection to the pool )is invoking it). When parallel requests
* does not have connections, they enqueue the requests. The next thread to
* check in will continue to process these requests, until the queue is
* drained or connection is exhausted. There is no number bound on this. For
* example If you bump the ExceededQuotaSlopTest to do more than 500
* requests it will fail and if you put a bound on this it will pass.
* Something that requires deeper investigation in the future.
*
* Attempts to repeatedly process enqueued resource requests. Tries until no
* more progress is possible without blocking.
*
Expand Down
8 changes: 8 additions & 0 deletions test/unit/voldemort/server/quota/ExceededQuotaSlopTest.java
Expand Up @@ -161,6 +161,14 @@ public void testAsyncWritesSloppedOnQuotaExceeed() throws Exception {
// Set quotas on each server
setGetPutQuotasForEachServer();

/**
* Look at the comment on this method
*
* @see voldemort.utils.pool.QueuedKeyedResourcePool.processQueueLoop(K)
* to see why bumping the number generateKeysForMasterNode will
* fail this test.
*/

// This test is non-deterministic.
// 1) The QuotaException is thrown by SerialPut, but parallelPut ignores
// QuotaException and throws InsufficientOperationalNodesException
Expand Down

0 comments on commit d34c946

Please sign in to comment.