Skip to content

Commit

Permalink
Complete MPU when allowed and under memory pressure
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalif committed Mar 20, 2024
1 parent 2366e87 commit f47f1d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ func (inode *Inode) sendUpload() bool {

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

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

0 comments on commit f47f1d9

Please sign in to comment.