fresh-borzoni commented on code in PR #145:
URL: https://github.com/apache/fluss-rust/pull/145#discussion_r2680679261


##########
crates/fluss/src/client/write/accumulator.rs:
##########
@@ -281,60 +301,76 @@ impl RecordAccumulator {
             return Ok(ready);
         }
 
-        let mut nodes_drain_index_guard = self.nodes_drain_index.lock().await;
-        let drain_index = 
nodes_drain_index_guard.entry(node.id()).or_insert(0);
-        let start = *drain_index % buckets.len();
+        // Get the start index without holding the lock across awaits
+        let start = {
+            let mut nodes_drain_index_guard = 
self.nodes_drain_index.lock().await;
+            let drain_index = 
nodes_drain_index_guard.entry(node.id()).or_insert(0);
+            *drain_index % buckets.len()
+        };
+
         let mut current_index = start;
+        let mut last_processed_index;

Review Comment:
   It would require #[allow(unused_assignments)]  with this suggestion.



-- 
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