Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the RetryPolicy for the GA release, keeping ShouldRetry extension point hidden. #5771

Merged
merged 5 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/core/azure-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Other Changes

- Updated JSON library to 3.11.3.
- Hide methods on the `RetryPolicy` that are not intended for public use.

## 1.13.0-beta.1 (2024-06-06)

Expand Down
21 changes: 19 additions & 2 deletions sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
#include <utility>
#include <vector>

#if defined(_azure_TESTING_BUILD)
// Define the classes used from tests
namespace Azure { namespace Core { namespace Test {
class RetryPolicyTest;
class RetryLogic;
}}} // namespace Azure::Core::Test
#endif

/**
* A function that should be implemented and linked to the end-user application in order to override
* an HTTP transport implementation provided by Azure SDK with custom implementation.
Expand Down Expand Up @@ -363,7 +371,16 @@ namespace Azure { namespace Core { namespace Http { namespace Policies {
/**
* @brief HTTP retry policy.
*/
class RetryPolicy : public HttpPolicy {
class RetryPolicy
#if !defined(_azure_TESTING_BUILD)
final
#endif
: public HttpPolicy {
#if defined(_azure_TESTING_BUILD)
// make tests classes friends
friend class Azure::Core::Test::RetryPolicyTest;
friend class Azure::Core::Test::RetryLogic;
#endif
private:
RetryOptions m_retryOptions;

Expand Down Expand Up @@ -398,7 +415,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies {
*/
static int32_t GetRetryCount(Context const& context);

protected:
private:
virtual bool ShouldRetryOnTransportFailure(
RetryOptions const& retryOptions,
int32_t attempt,
Expand Down
Loading