Skip to content

contextutil: RunWithTimeout error message is misleading #79424

@erikgrinaker

Description

@erikgrinaker

contextutil.RunWithTimeout gives error messages like:

operation "send-snapshot" timed out after 1h0m0s (took 10s): ‹rpc error: code = DeadlineExceeded desc = context deadline exceeded›

Where 1h0m0s is the timeout passed to RunWithTimeout(). However, this is misleading, because either the caller or callee can have set their own context timeout that is smaller than the timeout given to RunWithTimeout.

This is even worse in older releases, where the "(took 10s)" part is not present, leading readers to believe the operation actually took 1 hour.

Jira issue: CRDB-14833

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions