Skip to content

Commit

Permalink
Merge pull request #47 from ozontech/fix-fd-leak
Browse files Browse the repository at this point in the history
[fd-fix] add file close in maintenanceJob
  • Loading branch information
vitkovskii authored Feb 16, 2022
2 parents 51bda38 + fd36b52 commit 26bb487
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugin/input/file/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,9 @@ func (jp *jobProvider) maintenanceJob(job *Job) int {
newInode := getInode(stat)
if newInode != inode {
jp.deleteJobAndUnlock(job)

if err = file.Close(); err != nil {
jp.logger.Errorf("can't close file %s %v in case of different inodes", filename, err)
}
return maintenanceResultDeleted
}

Expand Down

0 comments on commit 26bb487

Please sign in to comment.