Skip to content

re_grpc: consider network interruptions retryable - #1460

Closed
vlad-ivanov-name wants to merge 1 commit into
meta:mainfrom
vlad-ivanov-name:retry-cancelled-cas-reads
Closed

vlad-ivanov-name wants to merge 1 commit into
meta:mainfrom
vlad-ivanov-name:retry-cancelled-cas-reads

Conversation

@vlad-ivanov-name

Copy link
Copy Markdown
Contributor

Right now, intermittent network failures like these fail the build immediately:

Error: (Failed to make BatchReadBlobs request: code: 'The operation was
cancelled', message: "operation was canceled", source: tonic::transport::Error(
Transport, hyper::Error(Canceled, "connection closed")): transport error:
operation was canceled: connection closed)

Add Cancelled cause to list of retryable errors.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 13, 2026
@meta-codesync

meta-codesync Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D115854815. (Because this pull request was imported automatically, there will not be any future comments.)

Right now, intermittent network failures like these fail the build immediately:

```
Error: (Failed to make BatchReadBlobs request: code: 'The operation was
cancelled', message: "operation was canceled", source: tonic::transport::Error(
Transport, hyper::Error(Canceled, "connection closed")): transport error:
operation was canceled: connection closed)
```

Add `Cancelled` cause to list of retryable errors.
@vlad-ivanov-name
vlad-ivanov-name force-pushed the retry-cancelled-cas-reads branch from dfaf732 to 8c62994 Compare August 26, 2026 12:59
@vlad-ivanov-name

Copy link
Copy Markdown
Contributor Author

Rebased on master.

@vlad-ivanov-name

vlad-ivanov-name commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Seems like CI breakage is unrelated to this change. Edit: linux ci passed

@8Keep 8Keep left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot closed this in 3a643c7 Aug 26, 2026
@meta-codesync

meta-codesync Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

This pull request has been merged in 3a643c7.

@meta-codesync meta-codesync Bot added the Merged label Aug 26, 2026
arianvp pushed a commit to arianvp/buck2 that referenced this pull request Oct 14, 2026
This reverts commit 3a643c7, which made `retry` treat CANCELLED as
transient so that requests failing with

    hyper::Error(Canceled, "connection closed")

were sent again. hyper reports that for a request that was still waiting
to be sent when its connection closed, typically after a proxy recycled
the connection with a GOAWAY. The patched tonic now sends such a request
again by itself, on a new connection, so it no longer reaches `retry`.
The nginx GOAWAY example passes without it.

The client sets no deadlines, so CANCELLED can still come only from a
server resetting a stream with CANCEL, or from a request whose connection
closed before it was sent 16 times in a row. Those fail now instead of
being retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NBCkPZ5aLoM73ujG2GyuHA
arianvp pushed a commit to arianvp/buck2 that referenced this pull request Oct 14, 2026
This reverts commit 3a643c7, which made `retry` treat CANCELLED as
transient so that requests failing with

    hyper::Error(Canceled, "connection closed")

were sent again. hyper reports that for a request that was still waiting
to be sent when its connection closed, typically after a proxy recycled
the connection with a GOAWAY. The patched tonic now sends such a request
again by itself, on a new connection, so it no longer reaches `retry`.
The nginx GOAWAY example passes without it.

The client sets no deadlines, so CANCELLED can still come only from a
server resetting a stream with CANCEL, or from a request whose
connection closed before it could be sent, 16 times in a row. Those now
fail instead of being retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NBCkPZ5aLoM73ujG2GyuHA
arianvp pushed a commit to arianvp/buck2 that referenced this pull request Oct 15, 2026
This reverts commit 3a643c7, which made `retry` treat CANCELLED as
transient so that requests failing with

    hyper::Error(Canceled, "connection closed")

were sent again. hyper reports that for a request that was still waiting
to be sent when its connection closed, typically after a proxy recycled
the connection with a GOAWAY. The patched tonic now sends such a request
again by itself, on a new connection, so it no longer reaches `retry`.
The nginx GOAWAY example passes without it.

The client sets no deadlines, so CANCELLED can still come only from a
server resetting a stream with CANCEL, or from a request whose
connection closed before it could be sent, 16 times in a row. Those now
fail instead of being retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NBCkPZ5aLoM73ujG2GyuHA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants