Skip to content

[Bug]: KubernetesSandboxClient ignores per-call timeout overrides #4264

Open

Description

@lishibin

Description

KubernetesSandboxClient.merge(callOptions) does not apply the per-call timeout fields from KubernetesSandboxClientOptions.

The method copies the client defaults and merges fields such as namespace, workspace root, connection settings, and shutdownAfterSeconds, but it never reads these fields from callOptions:

  • sandboxReadyTimeoutSeconds
  • requestTimeoutSeconds
  • perAttemptTimeoutSeconds
  • portForwardTimeoutSeconds
  • cleanupTimeoutSeconds

As a result, a caller that passes a KubernetesSandboxClientOptions to create(...) cannot override the timeout for that sandbox. The call silently uses the client default instead. cleanupTimeoutSeconds is currently not consumed by the Kubernetes client lifecycle at all.

Reproduction

KubernetesSandboxClient client = new KubernetesSandboxClient(defaultOptions);
KubernetesSandboxClientOptions callOptions = new KubernetesSandboxClientOptions();
callOptions.setSandboxReadyTimeoutSeconds(5);
callOptions.setRequestTimeoutSeconds(7);
callOptions.setPerAttemptTimeoutSeconds(2);
callOptions.setPortForwardTimeoutSeconds(3);

client.create(workspaceSpec, null, callOptions);

The effective options remain the corresponding values from defaultOptions (or the built-in defaults), because merge never copies the call-level values. This is especially problematic for a one-off sandbox that needs a shorter deadline or a longer startup timeout without changing the shared client configuration.

Expected behavior

When a field is set in callOptions, it should override the client default for that create call, consistently with the other per-call options. The implementation should also either apply cleanupTimeoutSeconds during cleanup or remove/deprecate the unused option.

Relevant code

KubernetesSandboxClient.merge currently handles call-level options at lines 249-296, while the timeout fields are only copied from the client defaults in copy at lines 298-319.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions