Skip to content

Fix: disable go-redis default 3s read timeout that kills long-running queries#101

Open
Naseem77 wants to merge 2 commits into
masterfrom
fix/no-default-read-timeout
Open

Fix: disable go-redis default 3s read timeout that kills long-running queries#101
Naseem77 wants to merge 2 commits into
masterfrom
fix/no-default-read-timeout

Conversation

@Naseem77

Copy link
Copy Markdown

Problem

go-redis v9 silently applies a 3 second ReadTimeout when Options.ReadTimeout is left at 0. Any graph query taking longer than 3 seconds (bulk loads, deep traversals) fails with:

read tcp 127.0.0.1:53632->127.0.0.1:6499: i/o timeout

Worse, go-redis automatically retries the command up to 3 times (observed failure at ~12s = 3s x 4 attempts), re-executing write queries and duplicating data, while the server keeps running the original query.

Same class of bug already fixed in falkordb-rs (FalkorDB/falkordb-rs#297, redis-rs 500ms default) and JFalkorDB (FalkorDB/JFalkorDB#282, Jedis 2000ms default). falkordb-py, falkordb-ts and falkordb-php are unaffected.

Fix

When the caller leaves ReadTimeout/WriteTimeout unset, default them to -1 (no client-side deadline) in all entry points: FalkorDBNew, FalkorDBNewCluster, FromURL, plus both sentinel failover paths (which previously dropped the timeouts entirely). Query duration is governed by the server's TIMEOUT / TIMEOUT_DEFAULT configuration, consistent with the other FalkorDB clients. Explicitly-set timeouts are fully respected.

Validation

Against FalkorDB v4.20.1, UNWIND range(1,80000000) AS x RETURN sum(x) (~4-5s):

before after
FalkorDBNew fails at ~12s (3s timeout x 3 silent retries) OK in 5.3s, correct result
FromURL same failure OK in 4.2s, correct result
explicit ReadTimeout: 2s n/a still times out as expected (opt-in preserved)
  • go build, go vet, gofmt clean
  • Full test suite passes

Naseem77 added 2 commits July 16, 2026 11:34
go-redis silently applies a 3 second ReadTimeout when the caller leaves it
unset (0), so any graph query longer than 3 seconds failed with an i/o
timeout - and go-redis then retried the command up to 3 times, re-executing
writes - while the server kept running the query. Default ReadTimeout and
WriteTimeout to -1 (no client-side deadline) unless explicitly set; query
duration is governed by the server TIMEOUT / TIMEOUT_DEFAULT configuration,
matching the other FalkorDB clients. Also propagate the timeouts to the
sentinel failover client, which previously dropped them.
FalkorDBNewCluster and FromURL inherited the same hidden 3s ReadTimeout;
apply the same no-deadline defaults and propagate ReadTimeout/WriteTimeout
through the FromURL sentinel failover path for consistency.
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Naseem77, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 26 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aba1db26-8384-4594-8cf6-e84eeaab939d

📥 Commits

Reviewing files that changed from the base of the PR and between a3dca68 and 53cb069.

📒 Files selected for processing (1)
  • falkordb.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/no-default-read-timeout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant