> +                  closeClientButKeepContentStream(response);
> +                  // At this point, this is not an authentication request 
> returning 401
> +                  // Check if we already had seen this request
> +                  Integer count = retryCountMap.getIfPresent(command);
> +                  if(count!=null) {
> +                     // This request has failed before 
> +                     if(count.intValue() >= 4 ) {
> +                        logger.debug("too many 401s - giving up after: " + 
> count.intValue());
> +                        // 4 retries in the last 5 minutes; give up
> +                        return false;
> +                     } else {
> +                        // Retry just in case
> +                        logger.debug("invalidating authentication token - 
> retry " + count.intValue());
> +                        retryCountMap.put(command, new 
> Integer(count.intValue()+1));
> +                        // Wait between retries
> +                        Uninterruptibles.sleepUninterruptibly(5, 
> TimeUnit.SECONDS);

Make configurable? And sleep _after_ invalidating? Now, the cache is still 
consulted while we're sleeping, even though we think it should be invalid.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/104/files#r5645465

Reply via email to