Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

fix retries operations #351

Merged
merged 3 commits into from
May 26, 2015
Merged

Conversation

wandenberg
Copy link
Contributor

This is the same pull request as #328, just rebased (I'll close the old one)

The pull request #324 does not deal with write operations after a replicaset reconfiguration.
And the tests with replicaset simulator does not represent the real world where the election of a new primary can take some seconds.

I moved some of the code I did on pull request #315 to this one based on tag 2.0.1.
I hope you can check and merge it on master.
The tests are done with a real replicaset using the stepDown command.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.39%) to 94.24% when pulling 4926c2c on wandenberg:fix_retries_operations into 6a58755 on mongoid:master.

durran added a commit that referenced this pull request May 26, 2015
@durran durran merged commit 68923e0 into mongoid:master May 26, 2015
@mateusdelbianco
Copy link

Finally!! 😃

@wandenberg wandenberg deleted the fix_retries_operations branch June 3, 2015 13:45
Loggable.warn(" MOPED:", "Retrying connection attempt #{retries} more time(s).", "n/a")
sleep(cluster.retry_interval)
cluster.refresh
with_retry(cluster, retries - 1, &block)
Copy link

Choose a reason for hiding this comment

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

why not use

retries -= 1
retry

here instead of recursion? Recursion is just going to add to the heap, whereas using retry should be a lot more lightweight.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants