mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 15:44:05 -08:00
Merge pull request #96 from prometheus/fdleak
Fix directory file descriptor leak.
This commit is contained in:
commit
0ec9456675
|
@ -300,6 +300,8 @@ func (c *compactor) write(uid ulid.ULID, blocks ...Block) (err error) {
|
|||
if err != nil {
|
||||
return errors.Wrap(err, "sync block dir")
|
||||
}
|
||||
defer df.Close()
|
||||
|
||||
if err := fileutil.Fsync(df); err != nil {
|
||||
return errors.Wrap(err, "sync block dir")
|
||||
}
|
||||
|
@ -583,6 +585,8 @@ func renameFile(from, to string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer pdir.Close()
|
||||
|
||||
if err = fileutil.Fsync(pdir); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue