Skip to content

Commit 5c91a27

Browse files
abe-winter10zingpd
authored andcommitted
APP-4406 add fsync in unpackFile (#3754)
1 parent 5aff91d commit 5c91a27

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

robot/packages/cloud_package_manager.go

+3
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,9 @@ func unpackFile(ctx context.Context, fromFile, toDir string) error {
648648
if _, err := io.CopyN(outFile, tarReader, maxPackageSize); err != nil && !errors.Is(err, io.EOF) {
649649
return errors.Wrapf(err, "failed to copy file %s", path)
650650
}
651+
if err := outFile.Sync(); err != nil {
652+
return errors.Wrapf(err, "failed to sync %s", path)
653+
}
651654
utils.UncheckedError(outFile.Close())
652655
case tar.TypeLink:
653656
name := header.Linkname

0 commit comments

Comments
 (0)