-
Notifications
You must be signed in to change notification settings - Fork 4
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
[#IOPSC-118] Respond with 'too many requests' status code when creating too much subscriptions for the same account #202
Conversation
Example of PR titles that include pivotal stories:
Generated by 🚫 dangerJS |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
if (error === null) { | ||
return false; | ||
} | ||
if (!(error instanceof RestError)) { | ||
return false; | ||
} | ||
if (!error.statusCode) { | ||
return false; | ||
} | ||
|
||
return error.statusCode === statusCode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not in fp-ts?
flow(
E.fromPredicate(
() =>
error instanceof RestError &&
error.statusCode === statusCode,
() => false
),
E.fold(
identity,
(_) => true
)
)(error);
List of Changes
See commit list
Motivation and Context
Azure API Management may fail to create too many subscriptions for the same account. According to Microsoft support, this is due to its internal optimistic consistency mechanism. Such failures do not depend on us or on a specific traffic pattern and are non-deterministic from our perspective; nevertheless, they are treated as generic server errors 500 and are hard to be monitored apart and react to differently.
To improve our users' experience we decided to:
subscriptions.createOrUpdate
operation when a 412 error is returned, so our users do not have to care about anything at the cost of a slightly-higher response timeHow Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: