{"record":{"id":"ad9018265b2a732c","repo":"mlflow/mlflow","slug":"mlflow-deployment-predict-total-timeout-retry-ti","errorCode":null,"errorMessage":"MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT ({retry_timeout_seconds}s) is set lower than MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT ({timeout}s). This means the total retry timeout could expire before a single request completes, causing premature failures. For long-running predictions, ensure MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT >= MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT. Recommended: Set MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT to at least {timeout}s.","messagePattern":"MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT \\((.+?)s\\) is set lower than MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT \\((.+?)s\\)\\. This means the total retry timeout could expire before a single request completes, causing premature failures\\. For long-running predictions, ensure MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT >= MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT\\. Recommended: Set MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT to at least (.+?)s\\.","errorType":"console","errorClass":"UserWarning","httpStatus":null,"severity":"warning","filePath":"mlflow/utils/rest_utils.py","lineNumber":470,"sourceCode":"    if backoff_factor < 0:\n        raise MlflowException(\n            message=\"The backoff_factor value must be either 0 a positive integer. \"\n            f\"Got {backoff_factor}\",\n            error_code=INVALID_PARAMETER_VALUE,\n        )\n\n\ndef validate_deployment_timeout_config(timeout: int | None, retry_timeout_seconds: int | None):\n    \"\"\"\n    Validate that total retry timeout is not less than single request timeout.\n\n    Args:\n        timeout: Maximum time for a single HTTP request (in seconds)\n        retry_timeout_seconds: Maximum time for all retry attempts combined (in seconds)\n    \"\"\"\n    if timeout is not None and retry_timeout_seconds is not None:\n        if retry_timeout_seconds < timeout:\n            warnings.warn(\n                f\"MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT ({retry_timeout_seconds}s) is set \"\n                f\"lower than MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT ({timeout}s). This means the \"\n                \"total retry timeout could expire before a single request completes, causing \"\n                \"premature failures. For long-running predictions, ensure \"\n                \"MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT >= MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT. \"\n                f\"Recommended: Set MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT to at least {timeout}s.\",\n                stacklevel=2,\n            )\n\n\ndef _time_sleep(seconds: float) -> None:\n    \"\"\"\n    This function is specifically mocked in `test_rest_utils.py` to test the backoff logic in\n    isolation. We avoid wrapping `time.sleep` globally to prevent interfering with unrelated sleep\n    calls elsewhere in the codebase or in third-party libraries.\n    \"\"\"\n    time.sleep(seconds)\n","sourceCodeStart":452,"sourceCodeEnd":488,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/utils/rest_utils.py#L452-L488","documentation":"MLflow's REST client warns when MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT (aggregate retry budget) is smaller than MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT (per-request timeout). In that configuration the total budget can expire before even one request finishes, so retries are useless and requests fail prematurely.","triggerScenarios":"Calling deployment client predict/_call_endpoint (or streaming) with MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT < MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT, via validate_deployment_timeout_config.","commonSituations":"Users setting a low total timeout to 'fail fast' without realizing the per-request timeout must be smaller; long-running model predictions (minutes) with default single-request timeout higher than a short total timeout.","solutions":["Set MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT >= MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT (recommended: at least the per-request value)","Lower MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT if you want fast failure per request","Increase the total timeout for long-running predictions, e.g. MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT=3600","Unset one of the variables so MLflow applies its defaults"],"exampleFix":"// before\nexport MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT=120\nexport MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT=60\n// after\nexport MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT=120\nexport MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT=600","handlingStrategy":"validation","validationCode":"import os\nt = os.environ.get(\"MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT\")\ntt = os.environ.get(\"MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT\")\nif t and tt and float(tt) < float(t):\n    raise ValueError(\"MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT must be >= MLFLOW_DEPLOYMENT_PREDICT_TIMEOUT\")","typeGuard":null,"tryCatchPattern":"import warnings\nwith warnings.catch_warnings():\n    warnings.filterwarnings(\"error\", message=\"MLFLOW_DEPLOYMENT_PREDICT_TOTAL_TIMEOUT\")\n    try:\n        client.predict(deployment_id, df)\n    except UserWarning as w:\n        print(\"fix timeout config:\", w)","preventionTips":["Always set TOTAL >= per-request timeout in deployment configs","For long-running predictions, set generous total timeouts (e.g. 3600s)","Add a startup config check in services using the deployment client"],"tags":["timeout","configuration","http","retry"],"backgroundTag":"misconfigured-timeout","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}