Skip to content

@grpc/grpc-js throw 'Received RST_STREAM with code 0' with retry enabled #2569

@nooop3

Description

@nooop3

Problem description

@grpc/grpc-js throw 'Received RST_STREAM with code 0' with retry enabled

Reproduction steps

  • Start an example HelloWorld Golang grpc server in Kubernetes and enable the istio sidecar
  • To reduce the connection reset(reset reason: connection termination), we set the max_concurrent_streams: 256
  • Making multi-calls same time by nodeJs with large responses (like response size 6k/per request, and 1000 requests)
  • Got Error: 13 INTERNAL: Received RST_STREAM with code 0

Environment

  • Kubernetes with istio envoy sidecar enabled(Thanks orbstack Kubernetes environment, I can debug this error in local VSCode environment)
    • NodeJs -> client sidecar(envoy) -> server
    • NodeJs -> server sidecar(envoy) -> server
    • NodeJs -> client sidecar(envoy) -> server sidecar(envoy) -> server
  • Node version: v16.18.1
  • Node installation method: Docker image
  • If applicable, compiler version: N/A
  • Package name and version: @grpc/grpc-js version > 1.7.3

Additional context

Logs with GRPC_TRACE=all GRPC_VERBOSITY=DEBUG

D 2023-09-09T23:58:35.160Z | load_balancing_call | [1513] Received metadata
D 2023-09-09T23:58:35.160Z | retrying_call | [1512] Received metadata from child [1513]
D 2023-09-09T23:58:35.160Z | retrying_call | [1512] Committing call [1513] at index 0
D 2023-09-09T23:58:35.160Z | resolving_call | [256] Received metadata
D 2023-09-09T23:58:35.160Z | subchannel_call | [3256] HTTP/2 stream closed with code 0
D 2023-09-09T23:58:35.160Z | subchannel_call | [3256] ended with status: code=13 details="Received RST_STREAM with code 0"
D 2023-09-09T23:58:35.160Z | load_balancing_call | [1513] Received status
D 2023-09-09T23:58:35.160Z | load_balancing_call | [1513] ended with status: code=13 details="Received RST_STREAM with code 0"
D 2023-09-09T23:58:35.160Z | retrying_call | [1512] Received status from child [1513]
D 2023-09-09T23:58:35.160Z | retrying_call | [1512] state=COMMITTED handling status with progress PROCESSED from child [1513] in state ACTIVE
D 2023-09-09T23:58:35.160Z | retrying_call | [1512] ended with status: code=13 details="Received RST_STREAM with code 0"
D 2023-09-09T23:58:35.160Z | resolving_call | [256] Received status
D 2023-09-09T23:58:35.160Z | resolving_call | [256] ended with status: code=13 details="Received RST_STREAM with code 0"

Error: 13 INTERNAL: Received RST_STREAM with code 0
    at callErrorFromStatus (/[redacted]/grpc-node/examples/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
    at Object.onReceiveStatus (/[redacted]/grpc-node/examples/node_modules/@grpc/grpc-js/build/src/client.js:192:76)
    at Object.onReceiveStatus (/[redacted]/grpc-node/examples/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)
    at Object.onReceiveStatus (/[redacted]/grpc-node/examples/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
    at /[redacted]/grpc-node/examples/node_modules/@grpc/grpc-js/build/src/resolving-call.js:94:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
for call at
    at ServiceClientImpl.makeUnaryRequest (/[redacted]/grpc-node/examples/node_modules/@grpc/grpc-js/build/src/client.js:160:32)
    at ServiceClientImpl.<anonymous> (/[redacted]/grpc-node/examples/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
    at /[redacted]/grpc-node/examples/helloworld/dynamic_codegen/client.js:73:14
    at new Promise (<anonymous>)
    at main (/[redacted]/grpc-node/examples/helloworld/dynamic_codegen/client.js:72:21)
    at Object.<anonymous> (/[redacted]/grpc-node/examples/helloworld/dynamic_codegen/client.js:102:1)
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
    at Module.load (node:internal/modules/cjs/loader:1033:32)
    at Function.Module._load (node:internal/modules/cjs/loader:868:12) {
  code: 13,
  details: 'Received RST_STREAM with code 0',
  metadata: Metadata { internalRepr: Map(0) {}, options: {} }
}

Methods I can apply

  • Disable grpc.enable_retries by set grpc.enable_retries = 0
  • Downgrade to the version 1.7.3

It seems we can just ignore this error, and doesn't affect the results.
RST_STREAM with code NO_ERROR in HTTP2 RFC Error Codes

There are some similar cases in other projects:

So can we just ignore this NO_ERROR in the Node js SDK? Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions