hesampakdaman commented on code in PR #5806:
URL: https://github.com/apache/arrow-rs/pull/5806#discussion_r1617599628


##########
object_store/src/client/retry.rs:
##########
@@ -119,6 +121,35 @@ impl From<Error> for std::io::Error {
 
 pub type Result<T, E = Error> = std::result::Result<T, E>;
 
+/// Holds the configuration and controls the concurrency for retry requests.
+///
+/// `RequestContext` contains the retry configuration and a semaphore to limit
+/// the number of concurrent retry requests, ensuring that requests do not
+/// overwhelm the server.
+#[derive(Debug, Clone)]
+pub struct RequestContext {
+    /// Configuration for retrying requests.
+    ///
+    /// This configuration defines how retries should be handled, including
+    /// the backoff strategy and maximum retry limits.
+    pub config: RetryConfig,
+
+    /// Semaphore to limit the number of concurrent retry requests.
+    ///
+    /// The semaphore controls the number of retry requests that can be 
executed
+    /// concurrently, preventing too many requests from being sent at once.
+    pub semaphore: Arc<Semaphore>,
+}
+
+impl Default for RequestContext {
+    fn default() -> Self {
+        Self {
+            config: RetryConfig::default(),
+            semaphore: Arc::new(Semaphore::new(5)),

Review Comment:
   Alright, I take it we make it an optional!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to