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

fix(sqs): don't crash on multiple predefined queues with aws sts session #2224

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

iBluemind
Copy link

@iBluemind iBluemind commented Jan 10, 2025

Hi,

I discovered a crash that occurs when using predefined queues with AWS SQS by AWS STS authentication, as described in this documentation.

Even though multiple predefined queues are configured like the example below, only one queue is currently usable.
(If you use queue-2 first, queue-1 becomes unavailable afterward.)

transport_options = {
    'predefined_queues': {
        'queue-1': {
            'url': 'https://sqs.ap-northeast-2.amazonaws.com/xxx/aaa'
        },
        'queue-2': {
            'url': 'https://sqs.ap-northeast-2.amazonaws.com/xxx/bbb'
        }
    },
    'sts_role_arn': 'arn:aws:iam::<xxx>:role/STSTest'
}

The issue arises because the Channel._predefined_queue_clients variable is not updated, which prevents switching to another queue once one has been used.

Thanks

@iBluemind iBluemind force-pushed the fix/sts_session_with_multiple_predefined_queues branch from 9f0108f to 9d90b5c Compare January 10, 2025 10:14
Copy link

@jinsung-kang jinsung-kang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@devEunjaeYong devEunjaeYong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.50%. Comparing base (c5e25d2) to head (9d90b5c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
kombu/transport/SQS.py 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2224   +/-   ##
=======================================
  Coverage   81.50%   81.50%           
=======================================
  Files          77       77           
  Lines        9522     9524    +2     
  Branches     1151     1152    +1     
=======================================
+ Hits         7761     7763    +2     
  Misses       1569     1569           
  Partials      192      192           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

3 participants