Skip to content

rpc/requests: retryConnects reports success when every connect attempt timed out #22182

Description

@yperbasis

retryConnects in rpc/requests/request_generator.go retries an RPC connect with a per-attempt timeout inside an overall deadline. When the overall deadline expires it returns the last recorded dial error — which is nil if every attempt only ever hit its per-attempt timeout without a dial refusal. The caller then proceeds as if the connection succeeded, and whatever uses the client fails later in a more confusing way instead of a clean "could not connect within the budget".

This behavior exists on main (the recursive implementation) and was deliberately preserved — and pinned by a characterization test — in #22170's conversion to cenkalti/backoff (request_generator.go, the errors.Is(err, context.DeadlineExceeded) branch returning lastDialErr; its own comment notes "nil if attempts only ever timed out"). It was kept there because that PR was a behavior-preserving refactor; fixing it is a separate decision, hence this issue.

Scope: test/devnet tooling only (rpc/requests is the request-generator client used by integration tooling), so severity is low.

Suggested fix: when the overall deadline expires and lastDialErr is nil, return the context error (or a wrapped "connect timed out after N attempts" error) instead of nil, and flip the characterization test in retry_test.go that currently pins the nil result.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions