-
Notifications
You must be signed in to change notification settings - Fork 201
SG-38213 Prevent unexpected retries on error #379
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
base: master
Are you sure you want to change the base?
Conversation
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.
Looks good but I am worried we are going to create new regressions with removing that retry.
Did you identify when and why this retry on generic exceptions was introduced?
shotgun_api3/shotgun.py
Outdated
except Exception as e: | ||
self._close_connection() | ||
if attempt == max_rpc_attempts: | ||
LOG.debug("Request failed. Giving up after %d attempts." % attempt) | ||
raise | ||
LOG.debug(f"Request failed. Reason: {e}") | ||
raise |
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.
Why do we even keep this except block then?
Just for the _close_connection
?
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.
Here we can catch RemoteDisconected
or some other error which I don't remember rn about ClosedConnection or something like that.
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 don't understand this answer.
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.
Ok let me summarize it: We use this except block for timeout or any other server error. And this is what's been happening with this ticket's context.
It seems this concern was already identified before. If any regression happened, that can help us identify better use cases (and we can always let the customers use the previous versions). |
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.
Just 2 minor points, then I'll be happy :)
shotgun_api3/shotgun.py
Outdated
except Exception as e: | ||
self._close_connection() | ||
if attempt == max_rpc_attempts: | ||
LOG.debug("Request failed. Giving up after %d attempts." % attempt) | ||
raise | ||
LOG.debug(f"Request failed. Reason: {e}") | ||
raise |
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 don't understand this answer.
Co-authored-by: Julien Langlois <16244608+julien-lang@users.noreply.github.com>
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!
We want to control when python-api does a retry on error.
SSLEOFError
SSLHandshakeError
On
_make_call
function.We don't want to retry on a general exceptions (e.g. Timeout or remote disconnection) because we might send a resource modification request (create, batch create, etc) and we can end up duplicating things.