Skip to content

Commit e478a37

Browse files
committed
Complete MPU when allowed and under memory pressure
Fixes hang in a rather simple case: rm mnt/file && \ fio -name=test -ioengine=libaio -direct=1 -iodepth=4 -bsrange=4k-512k \ -rw=write -size=10G -filename=mnt/file && \ fio -name=test -ioengine=libaio -direct=1 -iodepth=4 -bsrange=4k-512k \ -rw=randwrite -size=10G -filename=ya/d2/bf Previous fixes to "infinite loop" + GetHoles fix the same case but with ~15s pause between fio write and randwrite to allow GeeseFS to complete MPU at least once
1 parent 2366e87 commit e478a37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ func (inode *Inode) sendUpload() bool {
769769

770770
canComplete = canComplete && !inode.IsRangeLocked(0, inode.Attributes.Size, true)
771771

772-
if canComplete && (inode.fileHandles == 0 || inode.forceFlush) {
772+
if canComplete && (inode.fileHandles == 0 || inode.forceFlush || atomic.LoadInt32(&inode.fs.wantFree) > 0) {
773773
// Complete the multipart upload
774774
inode.IsFlushing += inode.fs.flags.MaxParallelParts
775775
atomic.AddInt64(&inode.fs.stats.flushes, 1)

0 commit comments

Comments
 (0)