fix: set MaxRetryDelay to honour Graph API Retry-After up to 315s#119
fix: set MaxRetryDelay to honour Graph API Retry-After up to 315s#119Jeenil wants to merge 1 commit into
Conversation
|
Related to #129 ? |
|
Hey @ms-henglu could we get attention to this? Identity Governance endpoints are really petulant. The workarounds are worse than not implementing them at all... I hope nothing speaks against it, thanks! |
842950a to
8272e52
Compare
|
yes, its related. #129 was just fixed by #133 and this pr is complementary to #133 makes retry fire everywhere but does not set MaxRetryDelay, so those retries are still capped at 60s, which is what this fixes (identity governance returns retry-after up to ~315s). i also rebased on top of #133 so it applies cleanly. the baseline policy #133 added in client.go has the same 60s cap. i kept this pr scoped to options.go, but happy to open a follow-up pr to cover client.go too if you'd prefer it everywhere. sorry for the delay! |
@microsoft-github-policy-service agree |
Summary
Fixes #118.
The azure-sdk retry policy correctly reads the
Retry-Afterheader but caps the wait atMaxRetryDelay, which defaults to 60 s. The Graph API Identity Governance endpoint returnsRetry-Aftervalues up to 315 s, causing the SDK to retry too early, re-hit 429, and exhaust retries before the throttle window clears.Setting
MaxRetryDelay: 600 * time.Secondin bothNewRetryOptionsForReadAfterCreateandNewRetryOptionsensures the fullRetry-Afterduration is respected.#133 ("apply retry policy by default") makes retry fire on every request, including the read-after-create/existence-check path. but it doesn't set
MaxRetryDelay, so those retries are still capped at 60s. this pr is complementary: #133 = retry at all, this pr = retry waits the fullRetry-Afterwindow. rebased on top of #133 so it applies cleanly.Changes
internal/clients/options.go: addedMaxRetryDelay: 600 * time.Secondto bothNewRetryOptionsForReadAfterCreateandNewRetryOptions.Note to maintainers
I apologies the original issue title ("Retry-After not honoured") was misleading. The real problem is the missing
MaxRetryDelaycap. I've updated the issue body with the corrected root cause.I'm relatively new to contributing to this provider and happy to revise the approach if the 600 s value or placement isn't right. Please let me know if you'd prefer a different cap, a configurable option, or if this belongs somewhere else in the retry pipeline. Thank you for reviewing