| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -431,18 +431,23 @@ class Rietveld(object):
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        except urllib2.URLError, e:
 | 
					 | 
					 | 
					 | 
					        except urllib2.URLError, e:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          if retry >= (self._maxtries - 1):
 | 
					 | 
					 | 
					 | 
					          if retry >= (self._maxtries - 1):
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            raise
 | 
					 | 
					 | 
					 | 
					            raise
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          if (not 'Name or service not known' in e.reason and
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              not 'EOF occurred in violation of protocol' in e.reason and
 | 
					 | 
					 | 
					 | 
					          def is_transient():
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              not 'timed out' in e.reason and
 | 
					 | 
					 | 
					 | 
					            # The idea here is to retry if the error isn't permanent.
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              not 'The handshake operation timed out' in e.reason and
 | 
					 | 
					 | 
					 | 
					            # Unfortunately, there are so many different possible errors,
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              # On windows we hit weird bug http://crbug.com/537417
 | 
					 | 
					 | 
					 | 
					            # that we end up enumerating those that are known to us to be
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              # with message '[Errno 10060] A connection attempt failed...'
 | 
					 | 
					 | 
					 | 
					            # transient.
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              not (sys.platform.startswith('win') and
 | 
					 | 
					 | 
					 | 
					            # The reason can be a string or another exception, e.g.,
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                   isinstance(e.reason, socket.error) and
 | 
					 | 
					 | 
					 | 
					            # socket.error or whatever else.
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                   e.reason.errno == errno.ETIMEDOUT
 | 
					 | 
					 | 
					 | 
					            reason_as_str = str(e.reason)
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                )
 | 
					 | 
					 | 
					 | 
					            for retry_anyway in [
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              ):
 | 
					 | 
					 | 
					 | 
					                'Name or service not known',
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            # Usually internal GAE flakiness.
 | 
					 | 
					 | 
					 | 
					                'EOF occurred in violation of protocol',
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                'timed out']:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					              if retry_anyway in reason_as_str:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                return True
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            return False  # Assume permanent otherwise.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          if not is_transient():
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            raise
 | 
					 | 
					 | 
					 | 
					            raise
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        except socket.error, e:
 | 
					 | 
					 | 
					 | 
					        except socket.error, e:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          if retry >= (self._maxtries - 1):
 | 
					 | 
					 | 
					 | 
					          if retry >= (self._maxtries - 1):
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |