ray.serve.request_router.RunningReplica.update_replica_info#
- RunningReplica.update_replica_info(replica_info: RunningReplicaInfo) None[source]#
Update mutable fields from a new RunningReplicaInfo.
Called when reusing an existing wrapper in _update_running_replicas. Replicas dynamically load/unload models via record_multiplexed_model_ids, which triggers a broadcast with updated RunningReplicaInfo. Without this update, the router would use stale multiplexed_model_ids and break multiplexed model routing.
Because we reassign _replica_info, any property that reads from it (including max_ongoing_requests, node_id, availability_zone, etc.) will reflect the new values. Fields that are cached separately (e.g., _actor_handle) are NOT refreshed here because they are tied to the replica’s identity and should never change for a live replica.