Skip to content

tail on file that is regularly written to can fail due to file being locked (on Windows) #157

@roelandvh

Description

@roelandvh

Tailing a file that gets regularly written to, like Apache log files, can crash with message The process cannot access the file because another process has locked a portion of the file.. This happened on a Windows 10 (version 1903) installation.

Please also see influxdata/telegraf#6539 where I provide more details and steps that I used for reproducing including a minimal Go program that uses just the tail module. Although for reproducing I used github.com/influxdata/tail in that program, this probably also applies to github.com/hpcloud/tail, given that influxdata/tail and hpcloud/tail have minimal differences and there appear to be no differences in the relevant tailFileSync function.

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