From 95667702a9cfdbef81a36d57690de294c183a241 Mon Sep 17 00:00:00 2001 From: ML Metrics Team Date: Thu, 6 Feb 2025 09:19:38 -0800 Subject: [PATCH] Logs number of connected workers while waiting for a worker pool to be alive. PiperOrigin-RevId: 723962636 --- ml_metrics/_src/chainables/courier_worker.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ml_metrics/_src/chainables/courier_worker.py b/ml_metrics/_src/chainables/courier_worker.py index 111a4db2..9ab1e4c7 100644 --- a/ml_metrics/_src/chainables/courier_worker.py +++ b/ml_metrics/_src/chainables/courier_worker.py @@ -305,6 +305,14 @@ def wait_until_alive( if len(workers) >= minimum_num_workers: logging.info('chainable: pool connected %d workers', len(workers)) return + logging.log_every_n_seconds( + logging.INFO, + 'chainable: waiting for at least %d workers to be connected.' + ' Currently connected workers: %d', + _LOGGING_INTERVAL_SEC, + minimum_num_workers, + len(workers), + ) except Exception as e: # pylint: disable=broad-exception-caught logging.warning('chainable: exception when connecting: %s', type(e)) time.sleep(0)