You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a few reboots and such I determined that running the command in visual studio code's integrated terminal causes this problem, and in some unknown cases can cause CompileDaemon to yield this error until reboot. I'm not sure what about VSC causes the error, or why it is permanent sometimes but I think it can be worked around by simply not running it in VSC :)
So I assume you are starting CompileDaemon more than once in the VSC terminal? Because Walk() is only called once at the beginning. Maybe there are other instances of CompileDaemon lingering in the background, eating up all free file descriptors and at the end, Walk() in the new instance cannot open any more files?
In this case we only use CompileDaemon for one specific component of our software and only use it there. So there should have only been one instance.
I suspected that there was a lingering instance initially, but couldn't find evidence of that using ps or any other task manager. And it doesn't explain why after a reboot ->VSC start it'd be busted. I'll keep poking at it and will share anything interesting I find, but I don't know if there's anything in particular to figure out.
Found the solution! It turns out that -exclude-dir wouldn't exclude the desired directories, this is because of the ./ prefixing the directory name.The flag -exclude-dir=./vendor wouldn't ignore the vendor directory
Will looking through the source for the cause of my problems I saw that filepath.Walk had somthing interesting in it. info.Name() returns the name of the file. If it was walking over ./vendor/aws/foo.go it would be foo.go, is this intended behavior?
This problem would be detected earlier if CD had a verbose mode, plotting the watched directories. Good job at identifying the problem, I haven't looked into it yet but this looks promising. I will look into this momentarily.
A gotcha. This is from fsnotify.Watcher.Add() which roughly translates to the inotify_add_watch syscall which describes the failure mode ESPC as follows:
ENOSPC The user limit on the total number of inotify watches was
reached or the kernel failed to allocate a needed resource.
Activity
githubnemo commentedon Jan 26, 2017
That is unexpected.
Any special things concerning your environment? OS? What file system are you using?
cameracker commentedon Jan 31, 2017
Sorry for the delay.
After a few reboots and such I determined that running the command in visual studio code's integrated terminal causes this problem, and in some unknown cases can cause CompileDaemon to yield this error until reboot. I'm not sure what about VSC causes the error, or why it is permanent sometimes but I think it can be worked around by simply not running it in VSC :)
githubnemo commentedon Jan 31, 2017
Well, that's odd.
So I assume you are starting CompileDaemon more than once in the VSC terminal? Because
Walk()is only called once at the beginning. Maybe there are other instances of CompileDaemon lingering in the background, eating up all free file descriptors and at the end,Walk()in the new instance cannot open any more files?cameracker commentedon Jan 31, 2017
In this case we only use CompileDaemon for one specific component of our software and only use it there. So there should have only been one instance.
I suspected that there was a lingering instance initially, but couldn't find evidence of that using ps or any other task manager. And it doesn't explain why after a reboot ->VSC start it'd be busted. I'll keep poking at it and will share anything interesting I find, but I don't know if there's anything in particular to figure out.
Thanks for paying attention to this :)
robbert229 commentedon Mar 7, 2017
Encountered the same issue on a fresh reboot. Not using VSCode but I am using Atom.
githubnemo commentedon Mar 7, 2017
@robbert229 any infos on the environment you are using? How do you invoke CD?
robbert229 commentedon Mar 7, 2017
I am running Arch Linux, and I was attempting to invoke
Edit
Found the solution! It turns out that -exclude-dir wouldn't exclude the desired directories, this is because of the ./ prefixing the directory name.The flag
-exclude-dir=./vendorwouldn't ignore thevendordirectoryWill looking through the source for the cause of my problems I saw that
filepath.Walkhad somthing interesting in it.info.Name()returns the name of the file. If it was walking over./vendor/aws/foo.goit would befoo.go, is this intended behavior?githubnemo commentedon Mar 7, 2017
This problem would be detected earlier if CD had a verbose mode, plotting the watched directories. Good job at identifying the problem, I haven't looked into it yet but this looks promising. I will look into this momentarily.
githubnemo commentedon Mar 8, 2017
@robbert229 thanks for finding the actual issue behind this problem! It should be fixed now.
mrosentr commentedon Mar 15, 2017
I still have this issue with Ubuntu 16.04 64bit after recompiling fix#23.
githubnemo commentedon Mar 15, 2017
@mrosentr Can you paste the command line of how you invoke CD and the output when starting with
-verbose?mrosentr commentedon Mar 15, 2017
I use this one primarily:
CompileDaemon -directory=. -build="go build -o server" -command="./server" -color=true -verbose
Have also tried this:
CompileDaemon -directory=/path-to-source -build="go build -o server" -command="./server" -color=true -verbose
Output:
2017/03/15 14:22:17 Watching directory '.' for changes.
2017/03/15 14:22:17 filepath.Walk():no space left on device
githubnemo commentedon Mar 15, 2017
A gotcha. This is from
fsnotify.Watcher.Add()which roughly translates to theinotify_add_watchsyscall which describes the failure modeESPCas follows:Consider increasing the number of possible inotify watches.
mrosentr commentedon Mar 16, 2017
Increasing the inotify watches worked! ty!
sevkin commentedon Aug 7, 2017
@githubnemo plz add solution about fs.inotify.max_user_watches in notes section of readme
Document solution for #23