Skip to content

VPAAMP-698: Improve retry logic for CURL errors in AAMP#1690

Open
psiva01 wants to merge 6 commits into
dev_sprint_25_2from
feature/VPAAMP-698
Open

VPAAMP-698: Improve retry logic for CURL errors in AAMP#1690
psiva01 wants to merge 6 commits into
dev_sprint_25_2from
feature/VPAAMP-698

Conversation

@psiva01

@psiva01 psiva01 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a new utility function to centralize the handling of retryable curl transport failures and updates the retry logic across the downloader codebase to use this new function. It also adds comprehensive unit tests to ensure that all newly classified retryable curl errors are correctly retried.

Retry Logic Improvements:

  • Added a new function IsRetryableCurlFailure(CURLcode curlCode) to AampUtils.cpp and its header, which encapsulates logic for determining if a curl error is transient and should be retried. [1] [2]
  • Updated retry logic in AampCurlDownloader::Download and PrivateInstanceAAMP::GetFile to use IsRetryableCurlFailure instead of ad-hoc error checks, ensuring consistency and easier future maintenance. [1] [2]

Testing Enhancements:

  • Added a new parameterized test suite RetryableCurlFailureTests in FunctionalTests.cpp to verify that all errors classified as retryable by IsRetryableCurlFailure are actually retried and handled as expected.
  • Updated the fake implementation in FakeAampUtils.cpp to provide a stub for IsRetryableCurlFailure, supporting test coverage.

These changes improve the robustness and maintainability of curl error handling and make the retry mechanism more transparent and testable.

Reason for change: Added centralized helper for CURL error handling and
included all the transient curl failures typically treated as retryable.

Signed-off-by: psiva01 <sivasubramanian.patchaiperumal@ltts.com>
@psiva01
psiva01 requested a review from a team as a code owner July 6, 2026 07:32
@psiva01
psiva01 requested a review from Copilot July 6, 2026 07:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves AAMP download retry behavior by expanding the set of CURL transport errors treated as retryable and adding helper logic to make the retry decision clearer and more consistent across download paths.

Changes:

  • Added IsRetryableCurlFailure() helper(s) to classify transient CURL transport failures as retryable.
  • Updated retry decision logic in PrivateInstanceAAMP::GetFile() and AampCurlDownloader::Download() to use the new helper.
  • Added parameterized functional coverage for newly retryable CURL failures in the AampCurlDownloader utests.

Reviewed changes

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

File Description
test/utests/tests/AampCurlDownloader/FunctionalTests.cpp Adds a parameterized test verifying retries for additional retryable CURL failures.
priv_aamp.cpp Introduces retryable CURL failure classification helper and refactors retry condition in GetFile().
downloader/AampCurlDownloader.cpp Adds retryable CURL failure classification helper and uses it in the curl-failure retry condition.

Comment thread downloader/AampCurlDownloader.cpp Outdated
Comment thread priv_aamp.cpp Outdated
@psiva01

psiva01 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot implement the review comment from #1690 (comment).

psiva01 and others added 4 commits July 15, 2026 14:37
Signed-off-by: psiva01 <sivasubramanian.patchaiperumal@ltts.com>
Signed-off-by: psiva01 <sivasubramanian.patchaiperumal@ltts.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