Skip to content
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

Adds retry behavior for expander #978

Merged
merged 5 commits into from
Oct 24, 2016
Merged

Adds retry behavior for expander #978

merged 5 commits into from
Oct 24, 2016

Conversation

paulmooring
Copy link
Contributor

Currently expander will drop jobs when solr is unavailable. This PR adds configurable options to expander for max_retries and retry_wait to allow expander to retry writing to solr for a configurable number of times. This allows Solr restarts without dropping tasks.

Paul Mooring added 4 commits October 13, 2016 14:28
…of retries and wait time between retries configurable

Signed-off-by: Paul Mooring <[email protected]>
…ome state handling in the http_request_started and complete methods (as used by "post_to_solr"). This was fixed by forcing those methods to only run when retries is set to 0, because the method is recursive on failure the complete method is always run, but never more than once per document.

Signed-off-by: Paul Mooring <[email protected]>
Copy link
Contributor

@danielsdeleo danielsdeleo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@stevendanna stevendanna left a comment

Choose a reason for hiding this comment

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

Left a minor comment re the log message, but otherwise looks good to me.

log.error { "Failed to post to solr (connection error): #{indexed_object}" }

if retries < max_retries
log.info { "Retrying solr connection: #{indexed_object} attempt #{retries}" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be good for this to be something like "Retrying post to solr in #{retry_wait} seconds:" so that if you are tailing the logs you know about how long to wait before you get nervous again :D.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the message to

Retrying solr connection in RETRY_WAIT seconds: OBJECT attempt ATTEMPT_NUMBER

@stevendanna stevendanna merged commit 5f98984 into chef:master Oct 24, 2016
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.

None yet

4 participants