Scale back warnings.warn and add stacklevels= where appropriate.
[python_utils.git] / executors.py
index 336f2c72e2685157db362921ce2384fb1476423a..6ccd7b675c760315d05158d68dad0768cc0f0871 100644 (file)
@@ -493,7 +493,6 @@ class WeightedRandomRemoteWorkerSelectionPolicy(RemoteWorkerSelectionPolicy):
                     return worker
         msg = 'Unexpectedly could not find a worker, retrying...'
         logger.warning(msg)
-        warnings.warn(msg)
         return None
 
 
@@ -530,7 +529,6 @@ class RoundRobinRemoteWorkerSelectionPolicy(RemoteWorkerSelectionPolicy):
             if x == self.index:
                 msg = 'Unexpectedly could not find a worker, retrying...'
                 logger.warning(msg)
-                warnings.warn(msg)
                 return None
 
 
@@ -777,7 +775,6 @@ class RemoteExecutor(BaseExecutor):
                     msg += 'We\'re a backup and this may be caused by the original (or some '
                     msg += 'other backup) already finishing this work.  Ignoring this.'
                     logger.warning(msg)
-                    warnings.warn(msg)
                     return None
 
         # Kick off the work.  Note that if this fails we let
@@ -851,7 +848,6 @@ class RemoteExecutor(BaseExecutor):
             if p is not None:
                 msg = f"{bundle}: Failed to wrap up \"done\" bundle, re-waiting on active ssh."
                 logger.warning(msg)
-                warnings.warn(msg)
                 return self.wait_for_process(p, bundle, depth + 1)
             else:
                 self.status.record_release_worker(