INNER CODE UNIT · Python
_is_benign_metrics_bind_failure
Soju06/codex-lb · app/main.py:387
def _is_benign_metrics_bind_failure(exc: BaseException) -> bool:
return MULTIPROCESS_MODE and _is_metrics_bind_conflict(exc)
def _log_non_multiproc_metrics_bind_conflict(port: int) -> None:
logger.error(
"Metrics port %d is already bound by another worker process but PROMETHEUS_MULTIPROC_DIR is not set: "
"/metrics reflects only the winning worker's counters (1/N of traffic). "
"Set PROMETHEUS_MULTIPROC_DIR to a writable directory shared by all workers to aggregate metrics "
"across worker processes.",
port,
)
async def _close_db_and_record_clean_shutdown(
*,
database_tasks_drained: bool,
leader_lease_release_completed: bool,