-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add retry on trace not found #57
Conversation
) | ||
return response | ||
except ZionException as e: | ||
if "trace not found" in str(e): |
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.
We may move this functionality into the RPC side in the future, for now this will work for the specific error for trace not found which is a commonly encountered error. This is a stop gap measure until we decide to refactor our codebase to accommodate all the error types for retry.
self.assertNotEqual(self.counter, 10) | ||
self.assertGreater(end - start, 10) | ||
self.assertEqual(e, "Method not found") | ||
self.assertNotEqual(self.counter, 10) |
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.
Some previous integration tests did not actually check error message because they were inside the error checking flow, moved them outside so it properly checks now
Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com>
self.assertEqual(e, "condition is not a callable function") | ||
self.assertEqual(str(e.value), "condition is not a callable function") | ||
|
||
def test_retry_trace_not_found(self): |
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.
how is this test testing trace not found?
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.
is it because the tracing_heading is non-existent?
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.
Yeah, I just put in a random valid trace id format but it doesnt actually exist.
* add retry on trace not found * Update python-client/src/zion/__init__.py Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com> --------- Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com>
Issue number:
Summary
Add functionality for retrying on trace not found for fetch_trace_tree_until
Changes
Add a generic exception class called retryable exceptions that will be called so the retry decorator can retry on those exceptions. When we encounter a the common error trace not found it raises the retryable error so functions that are retrying, it will instead continue retrying instead of exiting because of the error
User experience
Mandatory Checklist
If your change doesn't seem to apply, please leave them unchecked.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.