Skip to content

[BUG] Gateway spec.server.timeouts and spec.mcp.timeouts.request are accepted but never applied #358

Closed

Description

Summary

The Gateway CRD accepts spec.server.timeouts.read, .write and .idle (defaults 60s, 60s, 300s) and spec.mcp.timeouts.request (default 10s), and examples/gateway-complete/gateway.yaml sets all four. buildContainer in internal/controller/gateway_controller.go never reads them, so the gateway keeps its own defaults. The gateway does have the matching settings: SERVER_READ_TIMEOUT, SERVER_WRITE_TIMEOUT and SERVER_IDLE_TIMEOUT (defaults 30s, 30s, 120s) and MCP_REQUEST_TIMEOUT (default 5s). Found by reading the code - not reproduced on a cluster.

Steps to Reproduce

  1. In a namespace labeled inference-gateway.com/managed=true, apply a Gateway with spec.server.timeouts: {read: 5s, write: 5s, idle: 10s} and spec.mcp: {enabled: true, timeouts: {request: 2s}}.
  2. List the env of the generated Deployment: kubectl get deployment <name> -o jsonpath='{.spec.template.spec.containers[0].env[*].name}'.
  3. Look for SERVER_READ_TIMEOUT, SERVER_WRITE_TIMEOUT, SERVER_IDLE_TIMEOUT and MCP_REQUEST_TIMEOUT.

Expected Behavior

The four values reach the gateway container as SERVER_READ_TIMEOUT, SERVER_WRITE_TIMEOUT, SERVER_IDLE_TIMEOUT and MCP_REQUEST_TIMEOUT, the way spec.mcp.timeouts.client, .dial, .tlsHandshake and .responseHeader already become MCP_CLIENT_TIMEOUT, MCP_DIAL_TIMEOUT, MCP_TLS_HANDSHAKE_TIMEOUT and MCP_RESPONSE_HEADER_TIMEOUT. Otherwise the fields are removed from the CRD and from examples/gateway-complete/gateway.yaml.

Actual Behavior

None of the four variables is set. grep -n "SERVER_READ_TIMEOUT\|SERVER_WRITE_TIMEOUT\|SERVER_IDLE_TIMEOUT\|MCP_REQUEST_TIMEOUT" internal/controller/gateway_controller.go returns nothing, and ServerTimeouts and MCPTimeouts.Request are referenced only by the API types, the generated deepcopy and one test fixture. The CRD defaults never take effect either: the gateway runs with 30s, 30s, 120s and 5s whatever the spec says.

Activity

  1. edenreich commented on Nov 17, 2026

    @edenreich
    Contributor

    @claude can you work on this? use /domain-driven-design /clean-architecture /ponytail:ponytail

  2. inference-gateway-maintainer commented on Nov 17, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Claude finished @edenreich's task in 3m 29s —— View job • fix/issue-358-20261117-0700 • [Create PR ➔](https://github.com/inference-gateway/operator/compare/main...fix/issue-358-20261117-0700?quick_pull=1&title=Issue%20%23358%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23358%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Fixed #358 - PR #363

    What changed

    • internal/controller/gateway_controller.go: the new serverTimeoutEnv function sits next to clientTLSEnv and turns the three server timeouts into env vars. Inside the MCP block, MCP_REQUEST_TIMEOUT is set when request has a value. Empty fields are skipped, the same way the A2A timeouts already work, so the gateway keeps its own default for any field left unset.
    • internal/controller/gateway_controller_test.go: one test checks that all four values reach the container. Another checks that unset fields produce no env var.
    • The CRD did not change, so there are no regenerated manifests.

    I confirmed that the gateway reads all four variables: they appear in its Configurations.md.

    The skills were only lightly useful here. This is a mapping from the spec to the gateway's env vars inside the existing controller, so there was nothing new to model. I kept the env names exactly as the gateway's own config uses them.

    Behavior change: if spec.server.timeouts is set, its CRD defaults now take effect: 60s/60s/300s replace the gateway's own 30s/30s/120s. Likewise, if spec.mcp.timeouts is set, request becomes 10s instead of 5s. If the timeouts block is left out, nothing changes. I did not test this on a cluster.

    Not done: the existing MCP timeouts (MCP_CLIENT_TIMEOUT and the others) still send an empty string if timeouts is set but a field is empty. I left that alone because it is outside this issue.

  3. moved this from Todo to In progress in 2026on Nov 17, 2026
  4. moved this from In progress to QA in 2026on Nov 17, 2026
  5. moved this from QA to Done in 2026on Nov 17, 2026
  6. inference-gateway-releaser commented on Nov 17, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.37.1 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreleased

    Type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions