>                 } else {
> -                  byte[] content = closeClientButKeepContentStream(response);
> -                  //TODO: what is the error when the session token expires??
> -                  if (content != null && new String(content).contains("lease 
> renew")) {
> -                     logger.debug("invalidating authentication token");
> -                     authenticationResponseCache.invalidateAll();
> -                     retry = true;
> +                  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 ) {

Formatting. Why `intValue()`, and why 4? Again, should that be configurable?

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

Reply via email to