ListQueues returns deleted queues #2451
-
Describe the bugAmazonSQSClient.ListQueues is including urls that have been deleted. These are recently deleted queues, but not too recent. Sometimes it has been a minute or two since it was deleted, and it is still returned. This is not a race condition, and it is happening a lot, like 50% of the time.
Expected Behavior
Current Behavior
Reproduction Steps
Possible SolutionI have no idea why this would be happening. Does the client or service cache the call to AmazonSQSClient.ListQueues? Additional Information/ContextNo response AWS .NET SDK and/or Package version usedAWSSDK.SQS 3.7.2.101 Targeted .NET Platform.Net Core 3.1 Operating System and versionWindows 10 |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Hi @Coder3333, Good afternoon. Thanks for reporting the issue. Just to mention here the SDK logic for SQS (for most part) is auto-generated from service models and for most part it's delegating the call to the service API operation. As per Amazon SQS: DeleteQueue service API operation, the deletion process takes up to 60 seconds (or may be more). So you might want to wait for sometime (preferably more than be 60 seconds) after you send request to delete the queues (you might also want to wait for successful delete response for each deleted queue). Is you wait time less than 60 seconds? Thanks, |
Beta Was this translation helpful? Give feedback.
-
@ashishdhingra - I am already waiting for the delete response to complete before calling ListQueues. Are you saying that after a Delete operation completes, it can still take another 60 seconds before the server actually registers the delete? |
Beta Was this translation helpful? Give feedback.
-
@Coder3333 Yes (as per Amazon SQS: DeleteQueue). The behavior is not controlled by the SDK. |
Beta Was this translation helpful? Give feedback.
-
@ashishdhingra - if that is the case, then my real issue is with AmazonSQSClient.DeleteQueue. It doesn't matter so much that it takes 60 seconds to take effect, but when I pass in a url for a queue that is already deleted, it should quietly ignore it, instead of throwing an exception. |
Beta Was this translation helpful? Give feedback.
-
@Coder3333 As stated earlier, the behavior is controlled by SQS service and is well documented. The ListQueues service API operation just returns the Queue Urls with no status of the queue. Hence, the only workaround for you is to wait for at least 60 seconds before you execute Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hi @Coder3333,
Good afternoon.
Thanks for reporting the issue.
Just to mention here the SDK logic for SQS (for most part) is auto-generated from service models and for most part it's delegating the call to the service API operation. As per Amazon SQS: DeleteQueue service API operation, the deletion process takes up to 60 seconds (or may be more). So you might want to wait for sometime (preferably more than be 60 seconds) after you send request to delete the queues (you might also want to wait for successful delete response for each deleted queue). Is you wait time less than 60 seconds?
Thanks,
Ashish