Skip to content

Commit

Permalink
Update the RetryPolicy for the GA release, keeping ShouldRetry extens…
Browse files Browse the repository at this point in the history
…ion point hidden. (Azure#5771)

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

* Mark test helper virtual functions private, so they aren't
accessible/callable by callers.

* Update the changelog.

* Update CL.
  • Loading branch information
ahsonkhan authored Jul 12, 2024
1 parent 313fb0e commit 9ccd206
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 202 deletions.
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

0 comments on commit 9ccd206

Please sign in to comment.