-
Notifications
You must be signed in to change notification settings - Fork 41
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
[ISILONQE-1417] Pike TimeoutError should be actionable #92
Conversation
Make pike.core.Frame._value_str a staticmethod which can be used in another module to format values the same way as the Frame pretty printer.
Allow a running program to overwrite pike.model.default_timeout for Future timeout. (as written before, the default_timeout gets baked into the function signature at module import time and changing the default_timeout variable has no effect)
TimeoutError.with_future is a factory classmethod that returns a TimeoutError with the .future attribute set. TimeoutError.__str__ formats the exception with the Future.request and Future.interim_response (if they exist).
Include a reference to the Future that timed out for better post-mortem analysis.
Pass a request value to all Futures to provide contextual information if the Future times out. These are not necessarily core.Frame objects.
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.
Great. Looks like from now we will have a detailed req/resp capture trace of where and when it timed out.
Review: I like this PR! 👍 |
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 ... tho futures feel like trying to think of 7+1 things at once. (asynch code in a static code review is hard).
I'm mostly sure this statement does not need an update https://github.com/emc-isilon/pike/pull/92/files#diff-ec153015e2fc91150abad84525c67330R950
hmm, that link doesn't point to a line for me. what line are you referring to? i may have missed a spot |
https://github.com/emc-isilon/pike/blob/master/pike/model.py#L915 |
ah okay, so that statement doesn't need to be updated... but it might benefit readability to update it as well as 912 to pass |
add Masen Furer to authors comment
add Masen Furer to authors comment
Improve readability by passing smb_req by kwarg when creating new Future instances.
@jtmoon79 updated author information and passing |
3.9 was released yesterday and deadsnakes wont use the -dev version anymore
had to bring in python 3.9-release for the CI workflow, since that was released after this PR was opened and 3.9-dev no longer works |
Add context to
TimeoutError
by optionally allowing it to be raisedwith_future
specified. If theFuture
has a.request
attribute, then it will be included in theTimeoutError
string representation.Callers may catch the
TimeoutError
and further inspect the.future
or even wait for it again.Update pike's use of
Future
to include relevant "request" context information where possible.Existing raisers of
pike.model.TimeoutError
outside of this package are unaffected as the signature and behavior of TimeoutError are backward compatible with the previous implementation.Testing Done
No explicit test cases are added for this change. Some scenarios were manually generated as an example and to check all code paths.
Connect Timeout
Session Setup Timeout:
Tree Timeout
Lease Timeout
Oplock Timeout
Create Timeout
Write Timeout
(This one could actually contain up to 1Mb of data, yikes!)
On a Future that has received an interim response
Still works without a future passed: