Skip to content

Deadlock when using fsnotify on Windows #54

@rubenhazelaar

Description

@rubenhazelaar

Hi, I'm new to Go and have written a very simple program to watch some logs (which rotate). However although the program runs fine for some time, eventually it deadlocks with the following message:

fatal error: all goroutines are asleep - deadlock! 

The code I'm using looks like this:

t, err := tail.TailFile("path/to/some/log", tail.Config{
    Follow: true,
    ReOpen: true})
if err != nil {
    log.Fatal(err)
}

for line := range t.Lines {
    // Some action based on a log line
}

I can provide a stacktrace if necessary

BTW: I'm on Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions