Skip to content

Commit 9ccd206

Browse files
authored
Update the RetryPolicy for the GA release, keeping ShouldRetry extension point hidden. (#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.
1 parent 313fb0e commit 9ccd206

3 files changed

Lines changed: 227 additions & 202 deletions

File tree

sdk/core/azure-core/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
### Other Changes
1212

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

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

sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
#include <utility>
3131
#include <vector>
3232

33+
#if defined(_azure_TESTING_BUILD)
34+
// Define the classes used from tests
35+
namespace Azure { namespace Core { namespace Test {
36+
class RetryPolicyTest;
37+
class RetryLogic;
38+
}}} // namespace Azure::Core::Test
39+
#endif
40+
3341
/**
3442
* A function that should be implemented and linked to the end-user application in order to override
3543
* an HTTP transport implementation provided by Azure SDK with custom implementation.
@@ -363,7 +371,16 @@ namespace Azure { namespace Core { namespace Http { namespace Policies {
363371
/**
364372
* @brief HTTP retry policy.
365373
*/
366-
class RetryPolicy : public HttpPolicy {
374+
class RetryPolicy
375+
#if !defined(_azure_TESTING_BUILD)
376+
final
377+
#endif
378+
: public HttpPolicy {
379+
#if defined(_azure_TESTING_BUILD)
380+
// make tests classes friends
381+
friend class Azure::Core::Test::RetryPolicyTest;
382+
friend class Azure::Core::Test::RetryLogic;
383+
#endif
367384
private:
368385
RetryOptions m_retryOptions;
369386

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

401-
protected:
418+
private:
402419
virtual bool ShouldRetryOnTransportFailure(
403420
RetryOptions const& retryOptions,
404421
int32_t attempt,

0 commit comments

Comments
 (0)