Skip to content

fix(ring): Pipelined returns error when shard is down #3417

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

Closed
wants to merge 2 commits into from

Conversation

kosiew
Copy link

@kosiew kosiew commented Jun 26, 2025

Closes
#3402

Problem

When a shard in a Ringis unreachable due to a network issue or a low DialTimeout、
•.'Ring.Pipelined () would not return an error. Instead, it failed silently, giving the false impression that the pipelined commands were successfully executed. This behavior was inconsistent with 'Client.Pipelined () and could lead to undetected data loss.

Solution

This change modifies the generalProcessPipeline function to correctly handle and propagate errors.

  • It now captures the first error that occurs when attempting to get a shard client or execute the pipeline on a shard.
  • A sync.Mutex is used to ensure thread-safe error reporting| from the concurrent shard operations.
  • The captured error is returned to the caller of Pipelined () , ensuring that failures are no longer silent.
    A new test case has also been added to verify that Pipelined () 、returns a dial error when a shard is unreachable, preventing future regressions.

@ndyakov
Copy link
Member

ndyakov commented Jun 26, 2025

Hello @kosiew, isn't this a duplicate of #3403 ?

@kosiew
Copy link
Author

kosiew commented Jun 26, 2025

Aaa..... 🤔
sorry, I did not know it was taken already.

@kosiew kosiew closed this Jun 26, 2025
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.

2 participants