Skip to content

fix: make dial tcp error redirectable (#3786)#3787

Merged
ndyakov merged 2 commits into
redis:masterfrom
vladisa88:vladis/make_dial_tcp_error_redirectable
Apr 23, 2026
Merged

fix: make dial tcp error redirectable (#3786)#3787
ndyakov merged 2 commits into
redis:masterfrom
vladisa88:vladis/make_dial_tcp_error_redirectable

Conversation

@vladisa88

@vladisa88 vladisa88 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #3786

The ShouldRetry() method now checks the timeout error for compliance with its dial tcp timeout error. If there is an error, the function returns true, since the request should be repeated. A dial error means the TCP connection was never established and the command was never sent to the server, so retry is always safe


Note

Low Risk
Low risk: small, targeted change to retry classification for network dial timeout errors, with added unit coverage. Potential impact is limited to slightly increasing retries on connection-establishment failures.

Overview
ShouldRetry now treats timeout errors that are specifically net.OpError with Op == "dial" as always safe to retry, since no command was sent to Redis.

Tests were updated to cover dial vs non-dial net.OpError cases.

Reviewed by Cursor Bugbot for commit e13fd6b. Bugbot is set up for automated code reviews on this repo. Configure here.

@jit-ci

jit-ci Bot commented Apr 22, 2026

Copy link
Copy Markdown

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

Comment thread error.go Outdated
@vladisa88 vladisa88 force-pushed the vladis/make_dial_tcp_error_redirectable branch from 57ff717 to 612d7a7 Compare April 22, 2026 14:29

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 612d7a7. Configure here.

Comment thread error_test.go Outdated
@vladisa88 vladisa88 force-pushed the vladis/make_dial_tcp_error_redirectable branch 2 times, most recently from 1567a81 to b10003a Compare April 23, 2026 09:41
@vladisa88 vladisa88 marked this pull request as draft April 23, 2026 09:48
@vladisa88 vladisa88 force-pushed the vladis/make_dial_tcp_error_redirectable branch from e13fd6b to 0435cdd Compare April 23, 2026 09:55
@vladisa88 vladisa88 marked this pull request as ready for review April 23, 2026 10:03

@ndyakov ndyakov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you @vladisa88, looks good to me!

@ndyakov ndyakov added the bug label Apr 23, 2026
@ndyakov ndyakov merged commit 903d6bd into redis:master Apr 23, 2026
38 checks passed
@vladisa88 vladisa88 deleted the vladis/make_dial_tcp_error_redirectable branch April 23, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dial timeout error is not redirectable

2 participants