1010
1111
1212_LOGGER = logging .getLogger (__name__ )
13-
13+ _SYNC_ALL_NO_RETRIES = 3
1414
1515class SplitSynchronizers (object ):
1616 """SplitSynchronizers."""
@@ -292,7 +292,7 @@ def synchronize_splits(self, till, sync_segments=True):
292292 _LOGGER .debug ('Error: ' , exc_info = True )
293293 return False
294294
295- def sync_all (self , max_retry_attempts = - 1 ):
295+ def sync_all (self , max_retry_attempts = _SYNC_ALL_NO_RETRIES ):
296296 """
297297 Synchronize all splits.
298298
@@ -303,10 +303,7 @@ def sync_all(self, max_retry_attempts=-1):
303303 while True :
304304 try :
305305 if not self .synchronize_splits (None , False ):
306- retry_attempts = self ._retry_block (max_retry_attempts , retry_attempts )
307- if max_retry_attempts != - 1 and retry_attempts == - 1 :
308- break
309- continue
306+ raise Exception ("split sync failed" )
310307
311308 # Only retrying splits, since segments may trigger too many calls.
312309 if not self ._synchronize_segments ():
@@ -317,10 +314,11 @@ def sync_all(self, max_retry_attempts=-1):
317314 except Exception as exc : # pylint:disable=broad-except
318315 _LOGGER .error ("Exception caught when trying to sync all data: %s" , str (exc ))
319316 _LOGGER .debug ('Error: ' , exc_info = True )
320- retry_attempts = self ._retry_block (max_retry_attempts , retry_attempts )
321- if max_retry_attempts != - 1 and retry_attempts == - 1 :
322- break
323- continue
317+
318+ retry_attempts = self ._retry_block (max_retry_attempts , retry_attempts )
319+ if max_retry_attempts != - 1 and retry_attempts == - 1 :
320+ break
321+ continue
324322
325323 _LOGGER .error ("Could not correctly synchronize splits and segments after %d attempts." , retry_attempts )
326324
0 commit comments