This is an automated email from the ASF dual-hosted git repository.
zhouky pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git
The following commit(s) were added to refs/heads/main by this push:
new 02492fe9f [CELEBORN-626][FOLLOWUP] Fix wrong update chunkOffsets when
final flush with empty buffer
02492fe9f is described below
commit 02492fe9f86ad0fb0441081156cf10958f50c4cc
Author: Shuang <[email protected]>
AuthorDate: Tue Jul 11 00:28:54 2023 +0800
[CELEBORN-626][FOLLOWUP] Fix wrong update chunkOffsets when final flush
with empty buffer
### What changes were proposed in this pull request?
Final flush with none empty buffer.
### Why are the changes needed?
This bug was introduced by
[CELEBORN-626](https://github.com/apache/incubator-celeborn/pull/1534/files)
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Pass UT
Closes #1702 from RexXiong/CELEBORN-626-dev.
Authored-by: Shuang <[email protected]>
Signed-off-by: zky.zhoukeyong <[email protected]>
---
.../org/apache/celeborn/service/deploy/worker/storage/FileWriter.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/FileWriter.java
b/worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/FileWriter.java
index c43e3c551..06eeb0695 100644
---
a/worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/FileWriter.java
+++
b/worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/FileWriter.java
@@ -260,7 +260,9 @@ public abstract class FileWriter implements DeviceObserver {
closed = true;
synchronized (flushLock) {
- flush(true);
+ if (flushBuffer.readableBytes() > 0) {
+ flush(true);
+ }
}
tryClose.run();