Skip to content

Add retryable client #252

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add retryable client #252

wants to merge 6 commits into from

Conversation

kbrwn
Copy link

@kbrwn kbrwn commented Mar 10, 2025

This commit introduces a retryable client to authzed-py, inspired by the retry logic in authzed-go. It enhances bulk importing by automatically falling back to WriteRelationships if the bulk import operation fails.

@kbrwn kbrwn requested a review from a team as a code owner March 10, 2025 19:40
Copy link

@barakmich barakmich left a comment

Choose a reason for hiding this comment

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

LGTM -- i was a little cautious around the string matching part, but it fails safe so I'm unbothered.

Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

See comments, otherwise LGTM

@@ -164,8 +164,14 @@ def __init__(
self.init_stubs(channel)


# Import after defining Client to avoid circular imports
from authzed.api.v1.retryable_client import RetryableClient, ConflictStrategy
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather move the client declarations into a client.py that's then imported into this file

kbrwn and others added 3 commits March 12, 2025 17:58
fix error

Co-authored-by: Tanner Stirrat <tstirrat@gmail.com>
Signed-off-by: Kyle Brown <kyle.steven.brown@gmail.com>
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