[JFMGC-8] Build failover solution for model serving infrastructure - #8
[JFMGC-8] Build failover solution for model serving infrastructure#8yakavaliou wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c3ba633. Configure here.
| return ( | ||
| isinstance(error, JointFMHTTPStatusError) | ||
| and error.status_code in _POOL_RETRYABLE_HTTP_STATUS_CODES | ||
| ) |
There was a problem hiding this comment.
Pool failover breaks sample batching
Medium Severity
post_json treats every 470 as a peer outage and keeps failover, overwriting last_error on each attempt. Oversized sample requests surface as 470 with INPUT_SIZE_EXCEEDED, so a later network failure can replace that capacity error. forecast only special-cases JointFMHTTPStatusError, so the batching fallback never sees the cap and the request fails instead of batching.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c3ba633. Configure here.
There was a problem hiding this comment.
This is an awesome contribution Yahor, thanks! Could we maybe make one small conceptual change?
Say I request 10K samples but the model has a capacity of 5K, then we were requesting 5K and then again 5K from the same instance. With several models, we not only have failover but we can speed up operations. Say we have 2 instances that can generate 5K samples, we can now run the requests in parallel, using both instances at the same time. Would that be possible?
mariusvilkas
left a comment
There was a problem hiding this comment.
I am not very familiar with the jointfm-client, but code does make sense to me.
Is there a way to call client to just get a status on the pool instances - like instance is offline or not reachable or something like that. Otherwise,
LGTM


How it works:
JOINTFM_DEPLOYMENT_IDS.470,502/503/504):Note
Medium Risk
Changes how hosted predictions are routed and retried in production; mis-pooled deployments are guarded by checkpoint checks, but behavior differs from single-deployment clients and deserves rollout validation.
Overview
Adds hosted multi-deployment failover via a new
JOINTFM_DEPLOYMENT_IDSselector (comma-separated, ≥2 unique IDs, same checkpoint; exclusive with other deployment selectors). Settings build aninstancespool onJointFMSettings; YAML/env samples and API docs document the option.Introduces
JointFMInstancePoolfor round-robinpredict/forecasttraffic, per-request retry across untried peers on transient errors (network/JointFMRequestErrorand configured retry HTTP codes such as 470/5xx), andprobe_all_healththat tolerates unreachable peers but fails onmodel_version/checkpoint_versionmismatch and sets sample batching cap to the minimummax_sample_countacross healthy peers.JointFMClientrouteshealth,predict, and sample-batched forecasts through the pool when multiple instances are configured, uses fail-fast transport per peer (max_attempts=1), and gates pool traffic on pooled health before resolving model version. Public exports includeJointFMInstancePoolandJointFMInstanceSettings.Reviewed by Cursor Bugbot for commit c3ba633. Bugbot is set up for automated code reviews on this repo. Configure here.