-
Notifications
You must be signed in to change notification settings - Fork 6
add new deterministic functions, non-retryable errors, and shutdown h… #33
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: main
Are you sure you want to change the base?
Conversation
f6f6a40 to
de68786
Compare
| self._stub = stubs.TaskHubSidecarServiceStub(channel) | ||
| self._logger = shared.get_logger("client", log_handler, log_formatter) | ||
|
|
||
| def __enter__(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.
add context manager option for clean closing
| # gRPC timeout mapping (pytest unit tests may pass None explicitly) | ||
| grpc_timeout = None if (timeout is None or timeout == 0) else timeout | ||
|
|
||
| # If timeout is None or 0, skip pre-checks/polling and call server-side wait directly |
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.
improves resource consumption on server side that might also lag behind client side
| @@ -0,0 +1,48 @@ | |||
| [mypy] | |||
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.
this is actually not used yet. just as reference. We'll need to run mypy and there are lots of changes required to make it pass
| pass | ||
|
|
||
|
|
||
| class NonRetryableError(Exception): |
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.
this is a new helper, that is present in Temporal but not us, where we can defined errors that are non-retryable so activities don't attempt to retry when raised
| next_delay_f, self._retry_policy.max_retry_interval.total_seconds() | ||
| ) | ||
| return timedelta(seconds=next_delay_f) | ||
| return timedelta(seconds=next_delay_f) |
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.
this fixes a bug with retry, as the login in line 400 above f datetime.utcnow() < retry_expiration: means that we should retry, but as this was badly indented if for some reason max_retry_interval is not none this was not working.
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.
this is also kind of mentioned in one of the gotchas in dapr/python-sdk#836, I found this bug beforehand, the other gotchas are gotchas or not-explained behavior
| @@ -0,0 +1,16 @@ | |||
| apiVersion: dapr.io/v1alpha1 | |||
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.
needed for e2e tests with dapr that should sub durabletask-go tests
…nistic functions similar to dotnet Signed-off-by: Filinto Duran <[email protected]>
dd94256 to
366b2f6
Compare
This is a split from asyncio PR #13 . Removing changes not related to asyncio changes