Skip to content
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 support to .remote for client retries #2403

Merged
merged 6 commits into from
Dec 2, 2024
Merged

Add support to .remote for client retries #2403

merged 6 commits into from
Dec 2, 2024

Conversation

rculbertson
Copy link
Contributor

@rculbertson rculbertson commented Oct 25, 2024

Closes SVC-179.

Adds support for retrying failures in client rather than server. This functionality is disabled by default, but can be enabled by setting the env var MODAL_CLIENT_RETRIES. Hiding it behind this feature flag allows us to merge the changes into main, so we can test it in production with high frequency monitoring, before exposing it to users.

The basic flow is this:

  1. Client calls FunctionMap, which returns retry policy, a JWT for the function call, and a JWT per pipelined input
  2. If input not pipelined, client calls FunctionPutInputs, which returns JWT per input.
  3. Client calls FunctionGetOutputs, which returns output
  4. Client checks output:
    a. If failure and a retry policy is specified: client calls new RetryInput endpoint passing input id, input payload, and JWTs from earlier for authentication. This will loop according to policy
    b. If failure and no retry policy is specified: exception is raised
    c. If success, return output to caller.

@rculbertson rculbertson changed the title [wip] Add support for client retries [wip] Add support to .remote for client retries Oct 25, 2024
@rculbertson rculbertson force-pushed the ryan/retries branch 2 times, most recently from b9d4ac7 to 0e4c9e1 Compare October 28, 2024 19:17
@rculbertson rculbertson force-pushed the ryan/retries branch 3 times, most recently from eba18f5 to e4d7fb8 Compare November 6, 2024 18:11
modal/functions.py Outdated Show resolved Hide resolved
@rculbertson rculbertson force-pushed the ryan/retries branch 7 times, most recently from f7d8b2b to e09464e Compare November 13, 2024 20:17
@rculbertson rculbertson changed the title [wip] Add support to .remote for client retries Add support to .remote for client retries Nov 14, 2024
@rculbertson rculbertson marked this pull request as ready for review November 14, 2024 02:19
@rculbertson rculbertson force-pushed the ryan/retries branch 3 times, most recently from 1a637d8 to 5b2bc03 Compare November 14, 2024 22:34
Copy link
Contributor

@gongy gongy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for taking a while. This is fantastic work @rculbertson and @rohansingh.

@rculbertson rculbertson merged commit d6fd2ae into main Dec 2, 2024
22 checks passed
@rculbertson rculbertson deleted the ryan/retries branch December 2, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants