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 7f084b095 fix(hdfs): fix infinite loop in write for HDFS failure 
(#6295)
7f084b095 is described below

commit 7f084b0957cde00e7b524b714ebc5bb36bc9b459
Author: ovenyang <[email protected]>
AuthorDate: Mon Jun 16 14:58:44 2025 +0800

    fix(hdfs): fix infinite loop in write for HDFS failure (#6295)
    
    HDFS: fix infinite loop in write for HDFS failure
---
 core/src/services/hdfs/writer.rs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/core/src/services/hdfs/writer.rs b/core/src/services/hdfs/writer.rs
index b4de18697..4c44cac85 100644
--- a/core/src/services/hdfs/writer.rs
+++ b/core/src/services/hdfs/writer.rs
@@ -65,6 +65,10 @@ impl oio::Write for HdfsWriter<hdrs::AsyncFile> {
         while bs.has_remaining() {
             let n = f.write(bs.chunk()).await.map_err(new_std_io_error)?;
             bs.advance(n);
+
+            if n == 0 {
+                f.flush().await.map_err(new_std_io_error)?;
+            }
         }
 
         self.size += len;

Reply via email to