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.
(cherry picked from commit 93eb92a)
  • Loading branch information
kvch committed Nov 19, 2018
1 parent 1e936ae commit 47295ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ https://github.com/elastic/beats/compare/v6.5.0...6.5[Check the HEAD diff]

*Affecting all Beats*

- Fixed `-d` CLI flag by trimming spaces from selectors. {pull}7864[7864]
- 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*

*Filebeat*
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 47295ae

Please sign in to comment.