boot-clj / boot

Build tooling for Clojure.
https://boot-clj.github.io/
Eclipse Public License 1.0
1.75k stars 180 forks source link

boot watch sometimes stops notifying for filesystem changes #607

Open kommen opened 7 years ago

kommen commented 7 years ago

We're running into issues where sometimes boot watch seemingly stops working and doesn't run the build pipeline any more after file changes. After restarting the boot instance it works again as expected.

I enabled the :verbose flag for the watch task and confirmed that it doesn't print anything when a file changes when I run into the issue. When starting a new boot instance in parallel, like boot --source-paths src watch show -f) this one does react to file changes, while the other one doesn't.

I also connected to the boot instance having the issue with nrepl, started a watch task in there with (boot (watch :verbose true) (show :fileset true)). This also doesn't react to file changes.

Any clue how I can debug what is going on?

Some info about the env this is happing:

boot -V:

#http://boot-clj.com
#Wed Apr 19 07:39:27 UTC 2017
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.9.0-alpha15
BOOT_VERSION=2.7.1

JVM: OpenJDK 64-Bit Server VM 1.8.0_121-8u121-b13-1~bpo8+1-b13

I don't know if this matters, but for completeness:

cat /proc/version
Linux version 4.9.13-moby (root@11fbdc1f630f) (gcc version 6.2.1 20160822 (Alpine 6.2.1) ) #1 SMP Tue Mar 21 21:21:05 UTC 2017

running in Docker 17.03.1-ce-rc1.

kommen commented 7 years ago

Looking into boot.core I noticed that the last-file-change atom is no longer being updated in the boot instance where watch stopped working.

martinklepsch commented 6 years ago

Hey @kommen, sorry you didn't get a reply to this earlier. It sounds like this happened fairly frequently, do you have any idea how it could be reproduced? Would you maybe be up to provide a repro case?

kommen commented 6 years ago

Unfortunately we weren't able to reproduce this reliably back then, but yes, this happened fairly frequently. My clojure/jvm debugging foo also wasn't strong enough to dig deeper and in the end this was a factor in this.

Sorry, I won't be able to provide a repro case here.

martinklepsch commented 6 years ago

Hey, if you still happen to have the git revisions it might be worth going back to those and running whatever you ran with boot -vvv watch ... this will print a lot of stuff. I think the output of this could already be very very helpful in figuring out what went wrong here.

Also do you happen to remember if you ever ran into this issue with an OS other than Linux and Oracle's JDKs?

Very sorry you had this experience and no one was around to help! 😿

PS. Feel free to reach out via Slack (same username) any time.

arichiardi commented 3 years ago

Old issue, but as mentioned it might be related to OpenJDK.

I tried both boot -vvv and (watch :verbose true) does not basically show the file system events coming and it's stuck at:

Filesystem: copying css/themes/material/assets/fonts/icons.woff2...
Sync complete.
Released java.util.concurrent.Semaphore@3d34d211[Permits = 1]...
Elapsed time: 1.712 sec
arichiardi commented 3 years ago

I have also tried to go for the Java way (only) and have run:

https://docs.oracle.com/javase/tutorial/essential/io/notification.html#overview

and

https://docs.oracle.com/javase/tutorial/displayCode.html?code=https://docs.oracle.com/javase/tutorial/essential/io/examples/WatchDir.java

It seems that is not working as well.

arichiardi commented 3 years ago

No that's a red herring. It seems the notification works perfectly. I was not seeing because I was modifying a nested file. Modifying a files into test triggers the logging. It seems that is a boot-only problem then.

arichiardi commented 3 years ago

I reverted to boot 2.7.1 and the watcher started working again. I was on 2.7.2.

arichiardi commented 3 years ago

Oh man, this is an horrible mistake on my side, I had BOOT_WATCHERS_DISABLE: yes in my .boot/boot.properties.