Skip to content
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

Error queue excluded from list queues prefix in ListQueues check #61

Open
andrewatwood opened this issue Jul 15, 2023 · 1 comment
Open

Comments

@andrewatwood
Copy link

Say I have two existing queues: a queue process-queue and an error queue error-queue.

My error queue is never flagged as existing because the ListQueues operation is prefixed to the main queue name:

queues = sqs.list_queues(QueueNamePrefix=self._queue_name)
main_queue_exists = False
error_queue_exists = False
if 'QueueUrls' in queues:
for q in queues['QueueUrls']:
qname = q.split('/')[-1]
if qname == self._queue_name:
main_queue_exists = True
if self._error_queue_name and qname == self._error_queue_name:
error_queue_exists = True

The listener attempts to create the error queue since it wasn't found, and gets a QueueAlreadyExists error immediately.

If I specify the error queue as process-queue-error and it already exists, I don't get any errors, because it comes back in the ListQueues call that uses the prefix.

A couple solutions to this but it's a pretty big issue for anyone using pre-created queues.

@jegesh
Copy link
Owner

jegesh commented Aug 8, 2023

Yeah the code is pretty naive about these things. Feel free to submit a PR with your implementation to solve your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants