This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 742e19610 feat(services/s3): add support for HTTP 429 TooManyRequests 
for S3-compatible services (#6589)
742e19610 is described below

commit 742e19610a22f907d23560d56b12b1b63776776d
Author: Justin Joseph <[email protected]>
AuthorDate: Tue Sep 23 18:50:52 2025 +0200

    feat(services/s3): add support for HTTP 429 TooManyRequests for 
S3-compatible services (#6589)
    
    feat(s3): add support for HTTP 429 TooManyRequests for S3-compatible 
services
---
 core/src/services/s3/error.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/core/src/services/s3/error.rs b/core/src/services/s3/error.rs
index 385b75fac..d48577bc6 100644
--- a/core/src/services/s3/error.rs
+++ b/core/src/services/s3/error.rs
@@ -47,6 +47,7 @@ pub(super) fn parse_error(resp: Response<Buffer>) -> Error {
         // Client Disconnect, we should retry it.
         499 => (ErrorKind::Unexpected, true),
         500 | 502 | 503 | 504 => (ErrorKind::Unexpected, true),
+        429 => (ErrorKind::RateLimited, true),
         _ => (ErrorKind::Unexpected, false),
     };
 
@@ -114,6 +115,10 @@ pub fn parse_s3_error_code(code: &str) -> 
Option<(ErrorKind, bool)> {
         // indicates a temporary issue with the service or server, such as 
high load,
         // maintenance, or an internal problem.
         "ServiceUnavailable" => Some((ErrorKind::Unexpected, true)),
+        // > Too Many Requests - rate limit exceeded.
+        //
+        // It's Ok to retry since later on the request rate may get reduced.
+        "TooManyRequests" => Some((ErrorKind::RateLimited, true)),
         _ => None,
     }
 }

Reply via email to