Skip to content

[Bug] Generic invoke does not propagate timeoutMs to Dubbo client, causing per-request timeout to fall back to 3s #1654

Backlog

Description

@dodjdnh

Problem

在泛化调用(POST /api/v1/service/generic/invoke)中,请求参数 timeoutMs 对 Dubbo 协议不生效。

pkg/console/service/service_generic_invoke.go(L233)虽然通过 context.WithTimeout 为 callCtx 设置了超时,但在 invokeGenericServiceRPC(L67-L104)创建 cli.NewGenericService(...) 时未将 req.TimeoutMs 通过 client.WithRequestTimeout / client.WithClientRequestTimeout 传入 dubbo-go Client。由于 Dubbo 协议的 DubboInvoker.getTimeout 依赖 Reference URL 上的 timeout 参数而非 callCtx.Deadline(),实际请求 URL 始终使用默认值 timeout=3s。

Expected Behavior

  • Actual:在 Dubbo 协议泛化调用中,对耗时 1000ms 的 Provider 方法传入 timeoutMs=100 时,调用未在 100ms 超时而是成功返回(反之传入大于 3000ms 的超时会在 3s 被提前中断)。
  • Expected:timeoutMs 应正确透传至底层 Dubbo Client / Reference 配置,使小于和大于默认 3s 的单次调用超时均按请求值生效。

Minimal Reproduction

  1. 启动暴露 Dubbo 协议延迟方法(如 delay(1000) 耗时 1000ms)的 Provider。
  2. 通过 InvokeServiceGeneric 或 POST /api/v1/service/generic/invoke 调用该方法并设置 timeoutMs: 100。
  3. 观察 Refer 日志可见 URL 中仍为 timeout=3s,且本次调用未超时并成功返回。

Related Issues

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