rjeczalik / notify

File system event notification library on steroids.
MIT License
903 stars 128 forks source link

FreeBSD - ZFS mounted drive #111

Closed steverob closed 7 years ago

steverob commented 7 years ago

Hi, I am trying to use notify to listen to CREATE events in a volume mounted over ZFS in a server running FreeBSD.

But the event does not get captured at all. The code works fine in my Ubuntu distribution.

Any idea why? Thanks!

ghost commented 7 years ago

Hi. Please show your code + output of mount + used commands with information on which mount point they are executed + output of freebsd-version.

steverob commented 7 years ago

@pblaszczyk sure. Here is the code -

package main

import (
  "github.com/rjeczalik/notify"
  "fmt"
  "os"
)

func init() {
  raven.SetDSN("XYZ")
}

func main() {

  c := make(chan notify.EventInfo, 10)
  watchRoot := os.Args[1]

  if err := notify.Watch(watchRoot + "/...", c, notify.Create); err != nil {
    raven.CaptureError(err, nil)
  }
  defer notify.Stop(c)

  for {
    fmt.Println("Waiting...")
    ei := <-c
    fmt.Println("Received: ", ei)
  }
}

FreeBSD Version - FreeBSD 10.0-RELEASE-p12

Output of mount - (this is a shared storage server, removed some lines) -

abcstore on /abcstore (zfs, NFS exported, local, noatime, nfsv4acls)
..
..
abcstore/vodstore/eventstream on /abcstore/vodstore/eventstream (zfs, NFS exported, local, noatime, nfsv4acls)

abcstore/vodstore/eventstream/recordings --> this is where I am watching from, recursively downwards.

steverob commented 7 years ago

@pblaszczyk any thoughts on this? Thanks for looking in...

ghost commented 7 years ago

Hi. Yes. Unfortunately I believe there is a bug here. Just to confirm that this is really the same scenario: please try watching on events notify.Create | notify.Write and check if with this configuration notify.Create events are triggered.

rjeczalik commented 7 years ago

Just fyi - debug logs may also be helpful, build/run your code with debug tag:

$ go run -tags debug main.go
steverob commented 7 years ago

@pblaszczyk thanks. THAT WORKS! :) Thanks a lot.

ghost commented 7 years ago

Closed by #112.