Skip to content

File (descriptor) not closed upon deletion #134

@idanya

Description

@idanya

I am tailing a file that at some point (while tailing) gets deleted. I don't use reopen option, when the file is deleted I expect the tail to stop. The tail really stops, but I can see the file descriptor is not.
when running lsof I can see all files tailed with a "(deleted)" string at the end.

Seems weird as tailFileSync starts with defer tail.close() and when the file gets deleted an ErrStop is raised and should just cause a return (triggering the defer).
What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions