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

File watching issues on Linux (tempdirs) #31

Closed
Deraen opened this issue Dec 8, 2014 · 0 comments
Closed

File watching issues on Linux (tempdirs) #31

Deraen opened this issue Dec 8, 2014 · 0 comments

Comments

@Deraen
Copy link
Member

Deraen commented Dec 8, 2014

Hi,

When trying tempdirs branch, I have problems with file watching. It seems that syncing files from source dirs to tempdirs is working but watch-task is broken. For some reason the watch-key is invalid.

Watch-service doesn't have any real changes on tempdirs branch so it could be that problem exists in master but is only triggered by something on tempdirs branch.

A watch key is created when a watchable object is registered with a watch service. The key remains valid until:

- It is cancelled, explicitly, by invoking its cancel method, or
- Cancelled implicitly, because the object is no longer accessible, or
- By closing the watch service.

I've been trying to debug this and I'm quite confident I have checked that none of those things are happening. I have added some debug prints to boot code and I have checked that

  • isValid is called right after retrieving it from watchService so there is no chance of cancel being called?
  • Dir being watched exists
  • Watch service has not been closed
~/Source/boot-cljx tempdirs  2m 38s
❯ boot dev
Starting new-watch-service src
Sync (src)  ->  #<File .boot/tmp/k3b/rcesf6>
([:cp #<File src/deraen/boot_cljx/impl.clj> #<File .boot/tmp/k3b/rcesf6/deraen/boot_cljx/impl.clj>] [:cp #<File src/deraen/boot_cljx.clj> #<File .boot/tmp/k3b/rcesf6/deraen/boot_cljx.clj>])
Sync (src)  ->  #<File .boot/tmp/k3b/rcesf6>
()
Sync (src)  ->  #<File .boot/tmp/k3b/rcesf6>
()
Starting new-watch-service .boot/tmp/k3b/6qp7pj, .boot/tmp/k3b/rcesf6, .boot/tmp/k3b/-p9hf6h
Starting file watcher (CTRL-C to quit)...

Sync (src)  ->  #<File .boot/tmp/k3b/rcesf6>
()
#<LinuxWatchKey sun.nio.fs.LinuxWatchService$LinuxWatchKey@4eb69366> watchable #<UnixPath .boot/tmp/k3b/rcesf6/deraen/boot_cljx> is-valid false exists true
watch service: invalid watch key
nREPL server listening: 0.0.0.0:49714
Writing pom.xml and pom.properties...
Writing boot-cljx-0.2.0-SNAPSHOT.jar...
Installing boot-cljx-0.2.0-SNAPSHOT.jar...
([:cp #<File .boot/tmp/k3b/11lgcg/boot-cljx-0.2.0-SNAPSHOT.jar> #<File target/boot-cljx-0.2.0-SNAPSHOT.jar>])
Elapsed time: 4.538 sec

What should be the next steps in resolving this?
Can anyone else reproduce this? https://github.com/Deraen/boot-cljx/tree/tempdirs and running boot dev should print "watch service: invalid watch key"
If needed I think I could create virtualbox image to test this (or Vagrant script which can be used to create the image).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants