-
Notifications
You must be signed in to change notification settings - Fork 3
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
now pylzy does not abort workflow in case of grpc error[WIP] #1074
base: master
Are you sure you want to change the base?
Conversation
self, | ||
name: str, | ||
owner: "Lzy", | ||
env: Env, | ||
provisioning: Provisioning, | ||
auto_py_env: PyEnv, | ||
*, | ||
eager: bool = False, | ||
interactive: bool = True |
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.
Remove tab here please
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
@@ -167,6 +171,8 @@ def __exit__(self, exc_type, exc_val, exc_tb) -> None: | |||
finally: | |||
if exc_type is None: | |||
self.__destroy() | |||
elif exc_type is AioRpcError: |
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 may be UNAVAILABLE, so we must abort wf in this case
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.
UNAVAILABLE is retryable error. Python lzy-client should repeat request in case. If after an amount of attempts lzy service is still unavailable so I believe that it is really UNAVAILABLE and an abort request is useless :)
@@ -145,6 +147,8 @@ def __enter__(self) -> "LzyWorkflow": | |||
self.__snapshot = DefaultSnapshot(self.owner.serializer_registry, storage_uri, self.owner.storage_client, | |||
self.owner.storage_name) | |||
return self | |||
except AioRpcError as 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.
except AioRpcError:
raise
@@ -167,6 +171,8 @@ def __exit__(self, exc_type, exc_val, exc_tb) -> None: | |||
finally: | |||
if exc_type is None: | |||
self.__destroy() | |||
elif exc_type is AioRpcError: |
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 think isinstance(e, AioRpcError)
would be more accurate here
No description provided.