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

[BUG FIX] Moped reconnects gracefully after a replica set reconfiguration #80

Closed
wants to merge 1 commit into from

Conversation

nviennot
Copy link
Contributor

Default settings:

  • number of retries: 30
  • sleep duration between retries: 1sec

TODO: rspec tests
TODO: mongoid.yml

…tion

Default settings:
  * number of retries: 30
  * sleep duration between retries: 1sec

TODO: rspec tests
@kareemk
Copy link

kareemk commented Sep 28, 2012

+1

@durran
Copy link
Member

durran commented Oct 5, 2012

Thanks... I'm looking at putting tests around this and pulling in.

@ghost ghost assigned durran Oct 5, 2012
durran added a commit that referenced this pull request Oct 6, 2012
Moped::Session now can take 2 additional options, :retry_interval which
is the time to wait before attempting an operation on a primary again,
and :max_retries which is the maximum number of times to attempt the
operation before raising an error.

:retry_interval defaults to 1 (second).
:max_retries defaults to 30.

Instead of Moped attempting to perform an operation on the primary twice
before raising an error, it now refreshes the node list and retries
again up to the max number at retry intervals.

Related to: #80, #60

Thanks to Nicolas Viennot for the initial pull request to set the base
for the changes.
durran added a commit that referenced this pull request Oct 6, 2012
Instead of Moped attempting to perform an operation on a secondary
twice before raising an error, it now refreshes the node list and
retries again up to the max number at retry intervals.

Related to: #80, #60
@durran
Copy link
Member

durran commented Oct 6, 2012

Okay I've pulled in and made some changes, most notably to be able to configure the time between retries and the max number. Thanks for the pull!

@durran durran closed this Oct 6, 2012
durran added a commit that referenced this pull request Oct 6, 2012
Moped::Session now can take 2 additional options, :retry_interval which
is the time to wait before attempting an operation on a primary again,
and :max_retries which is the maximum number of times to attempt the
operation before raising an error.

:retry_interval defaults to 1 (second).
:max_retries defaults to 30.

Instead of Moped attempting to perform an operation on the primary twice
before raising an error, it now refreshes the node list and retries
again up to the max number at retry intervals.

Related to: #80, #60

Thanks to Nicolas Viennot for the initial pull request to set the base
for the changes.
durran added a commit that referenced this pull request Oct 6, 2012
Instead of Moped attempting to perform an operation on a secondary
twice before raising an error, it now refreshes the node list and
retries again up to the max number at retry intervals.

Related to: #80, #60
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 0d8aa28 on nviennot:master into * on mongoid:master*.

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.

4 participants