这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jbret89
Copy link
Contributor

@jbret89 jbret89 commented Apr 23, 2025

Description

This pull request upgrades the AWS SDK used by the SQS backend from github.com/aws/aws-sdk-go (v1) to github.com/aws/aws-sdk-go-v2 (v2).

Motivation

The upgrade addresses a known issue with the v1 SDK’s credentials package that could cause goroutine starvation under load. The root of the problem lies in the synchronous and blocking nature of credential resolution in v1, particularly when multiple goroutines request credentials concurrently (e.g., under high task throughput). This can lead to system-wide delays, increased latency, and even deadlocks in extreme scenarios.

The AWS SDK for Go v2 introduces a redesigned credentials handling mechanism that is significantly more concurrency-friendly, non-blocking, and idiomatic. This change ensures more robust behavior in high-concurrency environments such as distributed task queues.

Changes
• Replaced all references to github.com/aws/aws-sdk-go/service/sqs with the v2 equivalent: github.com/aws/aws-sdk-go-v2/service/sqs.
• Updated config initialization to use the v2 style with config.LoadDefaultConfig.
• Modified request logic to match the new SDK’s API (e.g., sqs.NewFromConfig, updated input/output structs).

Impact
• Improved concurrency: The SQS backend is now more resilient under load due to improved internal handling of AWS credentials.
• Modernization: Keeps the project up to date with the latest AWS Go SDK developments.
• Backward compatibility: This change should remain backward compatible at the application level, though dependency updates are required.

@jbret89 jbret89 marked this pull request as ready for review April 23, 2025 14:57
@jbret89 jbret89 changed the title Upgrade aws sdk go version Upgrade AWD SDK to v2 Apr 23, 2025
@jbret89
Copy link
Contributor Author

jbret89 commented Apr 23, 2025

Before merging this PR, please take a look at this one #837

@RichardKnop RichardKnop merged commit 378ff34 into RichardKnop:master Jul 19, 2025
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.

2 participants