Skip to content

Commit

Permalink
Logs number of connected workers while waiting for a worker pool to b…
Browse files Browse the repository at this point in the history
…e alive.

PiperOrigin-RevId: 723962636
  • Loading branch information
ML Metrics Team authored and ml metrics authors committed Feb 6, 2025
1 parent 8ee6c61 commit 9566770
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ml_metrics/_src/chainables/courier_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9566770

Please sign in to comment.