-
Notifications
You must be signed in to change notification settings - Fork 209
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
Conversation
…of retries and wait time between retries configurable Signed-off-by: Paul Mooring <[email protected]>
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]>
… and cookbook Signed-off-by: Paul Mooring <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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}" } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
…xt retry Signed-off-by: Paul Mooring <[email protected]>
Currently expander will drop jobs when solr is unavailable. This PR adds configurable options to expander for
max_retries
andretry_wait
to allow expander to retry writing to solr for a configurable number of times. This allows Solr restarts without dropping tasks.