Skip to content

C# Runtime still clamps procedure HttpRequest.Timeout to 500ms (host max is 180s since #4630) #5747

Description

@edenricardo

Summary

The C# module Runtime still clamps HttpRequest.Timeout to 500ms in guest code before the request reaches the host. The host (PR #4630) already uses 30s default / 180s max, so C# modules cannot request a 30–180s timeout for HttpRequests. Omitting Timeout uses the host default (~30s) and works; setting any longer value makes the call fail in ~500ms.

Environment

  • SpacetimeDB CLI / host: 2.7.1
  • NuGet SpacetimeDB.Runtime: same version as the module (reproduced on 2.8.1 source)
  • Language: C# procedure + ctx.Http.Send

Evidence

crates/bindings-csharp/Runtime/Http.cs (tag v2.8.1):

  • private static readonly TimeSpan MaxTimeout = TimeSpan.FromMilliseconds(500);
  • Comments still say the host clamps to 500ms
  • Send(): if request.Timeout is set and > MaxTimeout, it is replaced with 500ms before procedure_http_request

Host change: #4630 (HTTP_DEFAULT_TIMEOUT 30s, HTTP_MAX_TIMEOUT 180s). C# guest clamp was not updated to match.

Workaround

Do not set HttpRequest.Timeout (pass null). The host then applies its default (~30s). This is insufficient for slow HttpRequest calls.

Expected

C# MaxTimeout (and docs on HttpRequest.Timeout) should match the host ceiling (180s), or at least not clamp below the host max. Setting Timeout = TimeSpan.FromSeconds(60) should result in a 60s host timeout, not 500ms.

Related

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