feat: Add CancellationToken support to AWS S3 methods#1718
Conversation
Add CancellationToken parameter (with default value) to all S3 bucket operation methods, allowing pipeline cancellation to propagate to AWS SDK calls. Also adds ConfigureAwait(false) for consistency. Affected methods: - Bucket, BucketEncryption, BucketLogging, BucketPolicy - BucketWebsite, BucketNotification, BucketReplication - BucketTagging, BucketVersioning, BucketAccelerateConfiguration - BucketAnalyticsConfiguration, BucketInventoryConfiguration - BucketMetricsConfiguration, BucketOwnershipControls - BucketRequestPayment, BucketIntelligentTieringConfiguration Fixes #1544 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SummaryAdds CancellationToken support and ConfigureAwait(false) to all AWS S3 bucket operation methods. Critical IssuesNone found ✅ SuggestionsConsistency across AWS services: The Lambda.cs class in the same package doesn't expose any async methods yet, but if similar wrapper methods are added to other AWS service classes (Lambda, etc.) in the future, they should follow this same pattern of accepting CancellationToken and using ConfigureAwait(false). Pattern verification: The changes correctly follow the established patterns in the codebase:
Verdict✅ APPROVE - No critical issues The implementation correctly addresses issue #1544 by enabling cancellation support while maintaining backward compatibility. The pattern is consistent with the rest of the codebase. |
There was a problem hiding this comment.
Pull request overview
This PR adds proper cancellation support to AWS S3 bucket operations by introducing CancellationToken parameters and applying ConfigureAwait(false) for consistent async behavior. This allows S3 operations to be cancelled when a pipeline is cancelled, preventing in-flight AWS API calls from continuing unnecessarily.
- Adds
CancellationToken cancellationToken = defaultto all 16 S3 method signatures - Propagates cancellation tokens to AWS SDK async method calls
- Adds
ConfigureAwait(false)to all async operations for consistent async patterns
Summary
CancellationToken cancellationToken = defaultparameter to all S3 bucket operation methodsConfigureAwait(false)for consistent async behaviorWhy
Previously, S3 operations could not be cancelled - if a pipeline was cancelled, in-flight AWS API calls would continue until completion. This change allows proper cancellation propagation.
Backward Compatibility
All methods use
CancellationToken cancellationToken = default, so existing code without cancellation tokens will continue to work without modification.Test plan
Fixes #1544
🤖 Generated with Claude Code