Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Feb 3, 2025

Important

Improves media upload retry logic in media_manager.py by refining error handling to target server errors and rate limiting while avoiding retries for client errors.

  • Error Handling:
    • Refined _request_with_backoff in media_manager.py to handle requests.exceptions.RequestException.
    • Added retry logic for 5xx server errors and 429 rate limiting.
    • Removed generic Exception catch to avoid retries on 4xx client errors (except 429).

This description was created by Ellipsis for aeb5e61. It will automatically update as commits are pushed.


Greptile Summary

Disclaimer: Experimental PR review

Improved error handling for media upload retries in the Python SDK, focusing on more precise retry logic for server errors and rate limiting.

  • Modified _request_with_backoff in langfuse/_task_manager/media_manager.py to specifically handle requests.exceptions.RequestException
  • Added targeted retry logic for 5xx server errors and 429 rate limiting responses
  • Removed generic Exception catch to prevent unnecessary retries on client errors
  • Improved error handling precision for media upload failures

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

hassiebp and others added 2 commits February 3, 2025 13:29
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@hassiebp hassiebp merged commit 57c86f7 into main Feb 3, 2025
8 of 10 checks passed
@hassiebp hassiebp deleted the fix-upload-retries branch February 3, 2025 13:57
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.

2 participants