util/contextutil: clarify RunWithTimeout error message#79767
util/contextutil: clarify RunWithTimeout error message#79767craig[bot] merged 1 commit intocockroachdb:masterfrom
RunWithTimeout error message#79767Conversation
tbg
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker)
b9f47ee to
8e4a7f8
Compare
`RunWithTimeout` gave an error message of this form: ``` operation "send-snapshot" timed out after 1m (took 1m): context deadline exceeded ``` However, this can be misleading because either the caller or callee can set their own context timeout that is less than then one set by `RunWithTimeout`, in which case it looks like: ``` operation "send-snapshot" timed out after 1m (took 1s): context deadline exceeded ``` This is even worse on old versions, where the "took 1s" is not included, leading the reader to believe the operation actually took 1m when it only took 1s. This patch clarifies the error message somewhat: ``` operation "send-snapshot" timed out after 1s (given timeout 1m): context deadline exceeded ``` Release note: None
8e4a7f8 to
f9e2bf3
Compare
|
TFTRs! bors r+ |
|
Build succeeded: |
|
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from f9e2bf3 to blathers/backport-release-21.1-79767: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 21.1.x failed. See errors above. error creating merge commit from f9e2bf3 to blathers/backport-release-21.2-79767: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 21.2.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
RunWithTimeoutgave an error message of this form:However, this can be misleading because either the caller or callee can
set their own context timeout that is less than then one set by
RunWithTimeout, in which case it looks like:This is even worse on old versions, where the "took 1s" is not included,
leading the reader to believe the operation actually took 1m when it
only took 1s.
This patch clarifies the error message somewhat:
Resolves #79424.
Release note: None