Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@carlos-villavicencio-adsk
Copy link
Contributor

@carlos-villavicencio-adsk carlos-villavicencio-adsk commented May 5, 2025

We want to control when python-api does a retry on error.

  • SSLEOFError
  • SSLHandshakeError

On _make_call function.

We don't want to retry on a general exceptions (e.g. Timeout or remote disconnection) because we might send a resource modification request (create, batch create, etc) and we can end up duplicating things. It seems this concern was already identified before.

@carlos-villavicencio-adsk carlos-villavicencio-adsk requested a review from a team May 5, 2025 21:00
Copy link
Member

@julien-lang julien-lang left a comment

Choose a reason for hiding this comment

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

Looks good but I am worried we are going to create new regressions with removing that retry.

Did you identify when and why this retry on generic exceptions was introduced?

shotgun_api3/shotgun.py Show resolved Hide resolved
@carlos-villavicencio-adsk
Copy link
Contributor Author

Looks good but I am worried we are going to create new regressions with removing that retry.

Did you identify when and why this retry on generic exceptions was introduced?

It seems this concern was already identified before.

If any regression happened, that can help us identify better use cases (and we can always let the customers use the previous versions).

Copy link
Member

@julien-lang julien-lang left a comment

Choose a reason for hiding this comment

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

Just 2 minor points, then I'll be happy :)

shotgun_api3/shotgun.py Show resolved Hide resolved
shotgun_api3/shotgun.py Outdated Show resolved Hide resolved
Co-authored-by: Julien Langlois <16244608+julien-lang@users.noreply.github.com>
julien-lang
julien-lang previously approved these changes May 7, 2025
Copy link
Member

@julien-lang julien-lang left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refines retry behavior in the Python API by logging exception reasons and updating tests to expect no automatic retries on general errors.

  • Updated tests to assert a single call and removed sleep interval checks.
  • Enhanced _make_call to log exception messages (e) on failures.
  • Bumped version in HISTORY.rst with a note about changing retry policy.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/test_client.py Updated assertion to expect a single HTTP call
tests/test_api.py Removed multi-retry assertions and adjusted log check
shotgun_api3/shotgun.py Changed exception handler to log the error reason
HISTORY.rst Added v3.8.5 entry explaining new retry policy
Comments suppressed due to low confidence (2)

tests/test_client.py:334

  • [nitpick] The assertion message still says "Call is repeated" but the test now expects only one call (no repeat). Consider updating this message to accurately reflect that no retries should occur.
"Call is repeated"

tests/test_api.py:2227

  • The test checks the log message but doesn’t verify that the request was only called once. Add an assertion on mock_request.call_count to ensure general exceptions do not trigger retries.
"Request failed.  Reason: not working",

shotgun_api3/shotgun.py Show resolved Hide resolved
HISTORY.rst Outdated Show resolved Hide resolved
julien-lang
julien-lang previously approved these changes Jun 13, 2025
Copy link
Member

@julien-lang julien-lang left a comment

Choose a reason for hiding this comment

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

LGTM!

Just one minor comment

HISTORY.rst Outdated Show resolved Hide resolved
Co-authored-by: Julien Langlois <16244608+julien-lang@users.noreply.github.com>
@carlos-villavicencio-adsk carlos-villavicencio-adsk merged commit 17c66c4 into master Jul 17, 2025
22 checks passed
@carlos-villavicencio-adsk carlos-villavicencio-adsk deleted the ticket/SG-38213 branch July 17, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.