Skip to content

Notify the VM about a transient error #66

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

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions python/restate/server_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,13 @@ async def create_run_coroutine(self,
except Exception as e:
if max_attempts is None and max_retry_duration is None:
# no retry policy
raise e
failure = Failure(code=500, message=str(e))
max_duration_ms = None if max_retry_duration is None else int(max_retry_duration.total_seconds() * 1000)
config = RunRetryConfig(max_attempts=max_attempts, max_duration=max_duration_ms)
self.vm.propose_run_completion_transient(handle, failure=failure, attempt_duration_ms=1, config=config)
# todo: log the error
self.vm.notify_error(repr(e), traceback.format_exc())
else:
failure = Failure(code=500, message=str(e))
max_duration_ms = None if max_retry_duration is None else int(max_retry_duration.total_seconds() * 1000)
config = RunRetryConfig(max_attempts=max_attempts, max_duration=max_duration_ms)
self.vm.propose_run_completion_transient(handle, failure=failure, attempt_duration_ms=1, config=config)
# pylint: disable=W0236
# pylint: disable=R0914
def run(self,
Expand Down