Skip to content

Make proxy connect timeout configurable via application properties #68

@ASR4

Description

@ASR4

Description

Both ProxyService and GrpcProxyService use a hardcoded 3-second timeout. In GrpcProxyService there is an explicit TODO acknowledging this:

// TODO: Use the configuration plan to determine the timeout.
long timeout = 3000; // Default timeout of 3 seconds.

In ProxyService, the HttpClient is constructed as a static field with a hardcoded connect timeout:

private static final HttpClient httpClient = HttpClient.newBuilder()
      .connectTimeout(Duration.ofSeconds(3))
      ...

Operators currently have no way to adjust this without rebuilding the image. A slow backend (e.g. an on-premises gRPC service or a large GraphQL query) will always timeout after 3 seconds with no recourse.

Proposed change

Expose two config properties in application.properties with defaults that preserve the current behaviour:

  • Connect/request timeout for HTTP backend calls (in seconds, default: 3)
    reshapr.proxy.backend.timeout.http=${RESHAPR_PROXY_BACKEND_TIMEOUT_HTTP:3}
  • Deadline for gRPC backend calls (in milliseconds, default: 3000)
    reshapr.proxy.backend.timeout.grpc=${RESHAPR_PROXY_BACKEND_TIMEOUT_GRPC:3000}

Injected via @ConfigProperty in ProxyService and GrpcProxyService. No behaviour change for existing deployments.

What this is not

This is proxy-level configuration only. Per-service timeout control driven by ConfigurationPlan is a larger change involving the data model and proto definitions and is out of scope for this issue.

Details

  • Module: proxy
  • Files:
    - proxy/src/main/java/io/reshapr/proxy/proxy/ProxyService.java
    - proxy/src/main/java/io/reshapr/proxy/proxy/GrpcProxyService.java
    - proxy/src/main/resources/application.properties
  • reShapr version: 0.0.8

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions