Skip to content

Retry Lando requests - #298

Merged
marco-c merged 1 commit into
masterfrom
retry_lando
Aug 5, 2026
Merged

Retry Lando requests#298
marco-c merged 1 commit into
masterfrom
retry_lando

Conversation

@marco-c

Copy link
Copy Markdown
Collaborator

This will help fixmozilla/code-review#3537.

CopilotAI left a comment

Copy link
Copy Markdown

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 introduces a shared, retry-enabled requests.Session helper and migrates Lando/Phabricator HTTP calls to use it, aiming to improve reliability of Lando requests (per the linked issue).

Changes:

  • Add utils.get_session() that returns a cached requests.Session configured with urllib3.Retry and a larger connection pool.
  • Switch libmozdata/lando.py and libmozdata/phabricator.py HTTP calls from direct requests.* usage to get_session(...).*.
  • Add an explicit urllib3 dependency in requirements.txt to support direct Retry usage.

Reviewed changes

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

FileDescription
requirements.txtAdds urllib3 as an explicit dependency for retry support.
libmozdata/utils.pyIntroduces cached, retry-configured requests.Session factory.
libmozdata/phabricator.pyUses shared retry-enabled session for Conduit POST requests (and removes prior bespoke retry loop).
libmozdata/lando.pyUses shared retry-enabled session for Lando GET/POST/DELETE calls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadlibmozdata/utils.py
Comment threadlibmozdata/utils.py
Comment threadlibmozdata/phabricator.py

@suhaibmujahidsuhaibmujahid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! The test failure seems unrelated.

@marco-c
marco-c merged commit 2bf0aa3 into masterAug 5, 2026
1 of 3 checks passed
@marco-c
marco-c deleted the retry_lando branch August 5, 2026 09:32
Sign up for freeto 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.

Avoid crashing on Lando API calls 50x

3 participants

@marco-c@suhaibmujahid