Skip to content

Commit

Permalink
Fix 0-byte uploads being stuck in postprocessing state in posixfs
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Oct 17, 2024
1 parent b5b01f7 commit b9cdfa2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/storage/utils/decomposedfs/upload/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ func (session *OcisSession) FinishUpload(ctx context.Context) error {
return err
}
}

// increase the processing counter for every started processing
// will be decreased in Cleanup()
metrics.UploadProcessing.Inc()
Expand Down Expand Up @@ -213,7 +212,9 @@ func (session *OcisSession) FinishUpload(ctx context.Context) error {
}
}

if !session.store.async {
// if the upload is synchronous or the upload is empty, finalize it now
// for 0-byte uploads we take a shortcut and finalize isn't called elsewhere
if !session.store.async || session.info.Size == 0 {
// handle postprocessing synchronously
err = session.Finalize()
session.store.Cleanup(ctx, session, err != nil, false, err == nil)
Expand Down

0 comments on commit b9cdfa2

Please sign in to comment.