.agents/skills/hybrid-cloud-rpc/references/deprecation.md
Removing an RPC method or service requires a 3-phase approach to avoid breaking cross-silo calls during deployment windows where silos may be running different code versions.
Use the hybrid_cloud.rpc.disabled-service-methods option to disable the method without removing code. This allows instant rollback.
# In Sentry options (or via the admin panel):
# Add "ServiceName.method_name" to the disabled list
options.set("hybrid_cloud.rpc.disabled-service-methods", [
"MyService.old_method",
])
When a disabled method is called remotely, it raises RpcDisabledException instead of making a network call. This is checked in _RemoteSiloCall._check_disabled().
| Option key | Type | Purpose |
|---|---|---|
hybrid_cloud.rpc.disabled-service-methods | list[str] | Disable specific methods (format: "ServiceName.method_name") |
hybridcloud.rpc.retries | int | Global retry count (default: 5) |
hybridcloud.rpc.method_retry_overrides | dict[str, int] | Per-method retry overrides (key: "service_key.method_name") |
hybridcloud.rpc.method_timeout_overrides | dict[str, float] | Per-method timeout overrides (key: "service_key.method_name") |
Tip: Before removing a method, set its retries to 0 and timeout to a low value to surface any remaining callers.
Search for all callers of the method:
grep -r "my_service\.old_method" src/ tests/
Update each caller to use the replacement method or inline the logic.
If the method is still needed during the transition, keep it implemented but add a deprecation comment:
@cell_rpc_method(resolve=ByOrganizationId())
@abstractmethod
def old_method(self, *, organization_id: int) -> RpcThing | None:
"""Deprecated: Use new_method instead. Remove after YYYY-MM-DD."""
pass
Deploy and verify zero traffic to the disabled method via metrics:
hybrid_cloud.dispatch_rpc.response_code with tag rpc_method=ServiceName.old_methodRpcDisabledException errors in SentryOnce confirmed that no callers remain:
service.pyimpl.pymodel.pyserial.py if now unusedhybrid_cloud.rpc.disabled-service-methods optionIf removing all methods from a service:
create_delegation() calllist_all_service_method_signatures() discovers via pkgutil.walk_packageshybrid_cloud.rpc.disabled-service-methods in production