You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cuopt.grpc.routing.RoutingClient diverges from the LP/MIP cuopt.grpc.linear_programming.Client in two ways that look like an oversight rather than a deliberate design choice, found while writing #1838's docs.
RoutingClient.__cinit__ already reuses the exact same C++ shim as Client (grpc_python_client_t), which already supported a grpc_python_client_connect_options_t overload for TLS at the time Routing over gRPC: VRP server + compiled C++/Cython client #1597 was written -- it just calls the plain 2-arg constructor instead of that overload.
TLS -- RoutingClient.__cinit__(target="host:port") calls grpc_python_client_t(host, port), the 2-arg constructor, whose tls_mode defaults to ENV. So it does pick up CUOPT_TLS_* env vars the same way Client's default tls=None does, but there is no way to pass tls=False (plain TCP, ignore env) or an explicit TlsConfig (custom CA / mTLS) the way Client(host, port, tls=...) allows.
Constructor signature -- RoutingClient(target: str = "localhost:50051") takes one "host:port" string; Client(host: str, port: int, *, tls=None) takes two args plus the keyword-only tls. Copy-pasting between the two client docs/examples is an easy mistake.
Proposed fix
Mirror Client.__init__ exactly: RoutingClient(host: str, port: int, *, tls=None), reusing the existing _connect_options_from_tls() helper and the TLS-options grpc_python_client_t constructor overload already used by Client. This is a signature change (not additive), so it needs a decision on whether RoutingClient has any external users yet to consider for compatibility, or whether it's safe to change outright pre-wide-release.
Summary
cuopt.grpc.routing.RoutingClientdiverges from the LP/MIPcuopt.grpc.linear_programming.Clientin two ways that look like an oversight rather than a deliberate design choice, found while writing #1838's docs.Evidence this was missed, not decided
Client's TLS support (tls=None/False/TlsConfig, PR Python grpc async api allow arguments for TLS #1525) landed 2026-07-10 -- over 5 weeks beforeRoutingClientwas added in PR Routing over gRPC: VRP server + compiled C++/Cython client #1597 (2026-08-18).RoutingClientwas the newer of the two, not the older one TLS was never backported to.RoutingClient.__cinit__already reuses the exact same C++ shim asClient(grpc_python_client_t), which already supported agrpc_python_client_connect_options_toverload for TLS at the time Routing over gRPC: VRP server + compiled C++/Cython client #1597 was written -- it just calls the plain 2-arg constructor instead of that overload.Gaps
RoutingClient.__cinit__(target="host:port")callsgrpc_python_client_t(host, port), the 2-arg constructor, whosetls_modedefaults toENV. So it does pick upCUOPT_TLS_*env vars the same wayClient's defaulttls=Nonedoes, but there is no way to passtls=False(plain TCP, ignore env) or an explicitTlsConfig(custom CA / mTLS) the wayClient(host, port, tls=...)allows.RoutingClient(target: str = "localhost:50051")takes one"host:port"string;Client(host: str, port: int, *, tls=None)takes two args plus the keyword-onlytls. Copy-pasting between the two client docs/examples is an easy mistake.Proposed fix
Mirror
Client.__init__exactly:RoutingClient(host: str, port: int, *, tls=None), reusing the existing_connect_options_from_tls()helper and the TLS-optionsgrpc_python_client_tconstructor overload already used byClient. This is a signature change (not additive), so it needs a decision on whetherRoutingClienthas any external users yet to consider for compatibility, or whether it's safe to change outright pre-wide-release.Related: #1632 (client completeness -- settings surface, docs), #1629 (chunking, separately tracked and already correctly scoped).