Skip to content

Commit

Permalink
Propagate Sync error when running SafeFileRotate (elastic#9069)
Browse files Browse the repository at this point in the history
Previously, it was possible SafeFileRotate encountered an error without propagating it, because the return value of os.Sync was not utilized.
From now on the errors from Sync are propagated.
  • Loading branch information
kvch committed Nov 15, 2018
1 parent ac3b322 commit 93eb92a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff]
- Fixed Support `add_docker_metadata` in Windows by identifying systems' path separator. {issue}7797[7797]
- Do not panic when no tokenizer string is configured for a dissect processor. {issue}8895[8895]
- Start autodiscover consumers before producers. {pull}7926[7926]
- Propagate Sync error when running SafeFileRotate. {pull}9069[9069]

*Auditbeat*

Expand Down
3 changes: 1 addition & 2 deletions libbeat/common/file/helper_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func SafeFileRotate(path, tempfile string) error {
return nil // ignore error
}
defer f.Close()
f.Sync()

return nil
return f.Sync()
}

0 comments on commit 93eb92a

Please sign in to comment.