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

@marco-c marco-c commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

This will help fix mozilla/code-review#3537.

Copilot AI 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.

File Description
requirements.txt Adds urllib3 as an explicit dependency for retry support.
libmozdata/utils.py Introduces cached, retry-configured requests.Session factory.
libmozdata/phabricator.py Uses shared retry-enabled session for Conduit POST requests (and removes prior bespoke retry loop).
libmozdata/lando.py Uses 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 thread libmozdata/utils.py
Comment thread libmozdata/utils.py
Comment thread libmozdata/phabricator.py

@suhaibmujahid suhaibmujahid 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 master Aug 5, 2026
1 of 3 checks passed
@marco-c
marco-c deleted the retry_lando branch August 5, 2026 09:32
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.

Avoid crashing on Lando API calls 50x

3 participants