Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rpc): drop request on context deadline #324

Merged
merged 1 commit into from May 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/rpc/engine.go
Expand Up @@ -140,12 +140,12 @@ func (e *Engine) Do(ctx context.Context, req Request) error {

// Start retrying.
sent, err := e.retryUntilAck(retryCtx, req)
if err != nil && !errors.Is(err, context.Canceled) {
if err != nil && !errors.Is(err, retryCtx.Err()) {
// If the retryCtx was canceled, then one of two things happened:
// 1. User canceled the original context.
// 1. User canceled the parent context.
// 2. The RPC result came and callback canceled retryCtx.
//
// If this is not an context.Canceled error, most likely we did not receive ack
// If this is not a Context’s error, most likely we did not receive ack
// and exceeded the limit of attempts to send a request,
// or could not write data to the connection, so we return an error.
return xerrors.Errorf("retryUntilAck: %w", err)
Expand Down