Skip to content

Commit

Permalink
Minor changes to deal with remaining TODOs in this change. I still be…
Browse files Browse the repository at this point in the history
…lieve there are some ugly code paths that fire off too many exceptions when we tear down a connection. Hopefully, the connection re-write that is starting off will clean up these ugly code paths.
  • Loading branch information
jayjwylie committed Oct 9, 2012
1 parent a28bcd9 commit 133b9c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Expand Up @@ -310,8 +310,6 @@ public void handleException(Exception e) {
e = new UnreachableStoreException("Failure in " + operationName + ": "
+ e.getMessage(), e);
try {
// TODO: when can callback end up being null? HAs something to
// do with destroying resources. --JJW
callback.requestComplete(e, 0);
} catch(Exception ex) {
if(logger.isEnabledFor(Level.WARN))
Expand Down Expand Up @@ -384,10 +382,10 @@ public void complete() {
} catch(Exception e) {
invokeCallback(e, (System.nanoTime() - startNs) / Time.NS_PER_MS);
} finally {
// TODO: checkin can throw an exception. should "iscomplete" be
// set before the call to checkin?
checkin(destination, clientRequestExecutor);
isComplete = true;
// checkin may throw a (new) exception. Any prior exception
// has been passed off via invokeCallback.
checkin(destination, clientRequestExecutor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/java/voldemort/utils/pool/QueuedKeyedResourcePool.java
Expand Up @@ -230,7 +230,7 @@ protected void destroyRequest(AsyncResourceRequest<V> resourceRequest) {
* @param requestQueue The queue for which all resource requests are to be
* destroyed.
*/
private void destroyRequestQueue(Queue<AsyncResourceRequest<V>> requestQueue) {
private synchronized void destroyRequestQueue(Queue<AsyncResourceRequest<V>> requestQueue) {
AsyncResourceRequest<V> resourceRequest = requestQueue.poll();
while(resourceRequest != null) {
destroyRequest(resourceRequest);
Expand Down

0 comments on commit 133b9c7

Please sign in to comment.