Skip to content

RoutingClient: no TLS support, and a constructor signature that diverges from Client #1839

Description

@ramakrishnap-nv

Summary

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.

Evidence this was missed, not decided

Gaps

  1. 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.
  2. 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.

Related: #1632 (client completeness -- settings surface, docs), #1629 (chunking, separately tracked and already correctly scoped).

Metadata

Metadata

Assignees

Labels

awaiting responseThis expects a response from maintainer or contributor depending on who requested in last comment.bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions