Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] #29

Open
gitbeyond opened this issue Mar 9, 2022 · 0 comments
Open

[BUG] #29

gitbeyond opened this issue Mar 9, 2022 · 0 comments
Assignees
Labels

Comments

@gitbeyond
Copy link

What went wrong:
file inotify event lose.

Steps to reproduce, or a short snippet of code that reproduces the problem:

Whe I watch a directory /data/apps/data/packages/, I use copy cmd to copy ten files into the directory at once.
But I can only receive about three events.

[root@nano-kvm-11 tmp]# ll /tmp/fstab*
-rw-r--r-- 1 root root 502 Mar  2 18:54 /tmp/fstab
-rw-r--r-- 1 root root 502 Mar  9 09:43 /tmp/fstab1
-rw-r--r-- 1 root root 502 Mar  9 12:00 /tmp/fstab10
-rw-r--r-- 1 root root 502 Mar  9 09:43 /tmp/fstab2
-rw-r--r-- 1 root root 502 Mar  9 09:43 /tmp/fstab3
-rw-r--r-- 1 root root 502 Mar  9 09:43 /tmp/fstab4
-rw-r--r-- 1 root root 502 Mar  9 09:43 /tmp/fstab5
-rw-r--r-- 1 root root 502 Mar  9 12:00 /tmp/fstab6
-rw-r--r-- 1 root root 502 Mar  9 12:00 /tmp/fstab7
-rw-r--r-- 1 root root 502 Mar  9 12:00 /tmp/fstab8
-rw-r--r-- 1 root root 502 Mar  9 12:00 /tmp/fstab9
[root@nano-kvm-11 tmp]# /bin/cp /tmp/fstab* /data/apps/data/packages/

System and build environment information

Please run and paste the output of the following commands:

go version: 1.17.3

go env | grep "CGO_ENABLED\|GOOS":

GOOS="linux"
CGO_ENABLED="1"

uname -r: 3.10.0-1160.11.1.el7.x86_64

Additional context:
Here is my sample code.

        w, err := fsevents.NewWatcher()
	if err != nil {
		return err
	}

	_, err = w.AddDescriptor(wc.WatchDir, eventType)
	if err != nil {
		return err
	}
	w.StartAll()
	go w.Watch()
        ...
        for {
              e := <-w.Events
	      log.Println("Getting a event: ", e.Name)
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants