-
Notifications
You must be signed in to change notification settings - Fork 862
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
Cognito | Delay in Receiving LimitExceededException #2011
Comments
Hi @Raoufaaali, Good morning. Thanks for posting the issue. When the request is invoked via SDK's service client, it goes through the internal SDK pipeline which has predefined steps to resolve credentials, configure logging, marshall request, send the Http request to the service, receive response, unmarshall the response (including any error response), etc. All these steps take time, specially resolving credentials (refer Credential and profile resolution for credential search order). Could you please share the following:
I'm not sure if AWS CLI caches the current client (AWS SDK for .NET also caches Http clients based on service client config) which could explain it returning in just 1 sec. Thanks, |
Hi @ashishdhingra I have enabled the Logging and Metrics and I can see that the delay is caused by retrying the call 4 times even though it failed with To answer your questions, the credentials are passed to Logs:
|
@Raoufaaali That might answer your question on why it doesn't fail/return error immediately. Retry mechanism is built to handle intermittent errors from service in the SDK. Refer Retries and timeouts for information on configurable retries and timeouts in AWS SDK for .NET. I'm unsure about the default values for AWS CLI. This needs review with the team if we should bypass retry for |
Need to check with AWS CLI on how retries for such exceptions are handled. @Raoufaaali As a workaround you could set maximum retries to |
We have ran into the same issue. We've been testing Cognito based authentication and password maintenance scenarios and while we know that there is a quota of 5 ChangePassword calls per hour, per user (https://docs.aws.amazon.com/cognito/latest/developerguide/limits.html), we've been trying to catch the response (max tries) and react to it. But it seems like the retry is kicking in before that and it takes a long time in dev environment or outright times out in lambda. According to the above referenced article (https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/retries-timeouts.html) we could configure retries when creating a client service. I was wondering if we could provide a modified services.TryAddAWSService<IAmazonCognitoIdentityProvider>(new AmazonCognitoIdentityConfig{ MaxErrorRetry = 2 }); |
@ashishdhingra Setting the retries to 0 fixes the problem in that the LimitExceededExeption is returned sooner. The downside of this workaround is that; now we lose the benefit of the retry mechanism for legit dropped connections..etc. An ideal fix, IMO, would be if the SDK didn't retry if the service returned |
Hi @Raoufaaali, After consulting with our team, we understand that the For your specific use case, as recommended earlier, you can try initializing the client with the service config Based on this explanation, I will be closing this request. Please let us know if you have further queries. Thanks. Regards, |
Comments on closed issues are hard for our team to see. |
Describe the bug
Delay in Receiving LimitExceededException for ResendConfirmationCode using the AWS SDK for .NET
The AWS SDK for .NET has the following bug related to Cognito
When calling ResendConfirmationCode using the SDK more than the allowed limit (5 calls per/ hour per/user), the call takes way too long to respond with a LimitExceededException.
This behavior seems to be isolated to the AWS SDK for .NET.
In comparison, the ResendConfirmationCode return LimitExceedException in less than 1 second when called via the cli.
The same issue is observed with the ConfirmForgotPassword
Expected Behavior
Receiving LimitExceededException should be taking around 1 second
Current Behavior
Receiving LimitExceededException is taking around 30 seconds
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.CognitoIdentityProvider 3.3.103.3 and current latest stable AWSSDK.CognitoIdenitityProvider 3.7.2.14
Targeted .NET Platform
.NET Framework 4.5
Operating System and version
Windows 10, Windows 11, WindowsServer 2016 Core
The text was updated successfully, but these errors were encountered: