THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

file: Fix regression in fsnotify code

This was a major deadlock that hit the file resource. I didn't notice it
earlier because I was using an older version of fsnotify and I hadn't
done a go get -u to refresh it. I finally tracked this down, and will
vendor the repository until a fix upstream or a workaround downstream is
added.

The upstream issue is: https://github.com/fsnotify/fsnotify/issues/123
pull/77/head
James Shubin 5 years ago
parent
commit
654b3e9dbe
  1. 3
      .gitmodules
  2. 2
      README.md
  3. 1
      resources/file.go
  4. 1
      vendor/gopkg.in/fsnotify.v1

3
.gitmodules

@ -7,3 +7,6 @@
[submodule "vendor/github.com/grpc-ecosystem/grpc-gateway"]
path = vendor/github.com/grpc-ecosystem/grpc-gateway
url = https://github.com/grpc-ecosystem/grpc-gateway
[submodule "vendor/gopkg.in/fsnotify.v1"]
path = vendor/gopkg.in/fsnotify.v1
url = https://gopkg.in/fsnotify.v1

2
README.md

@ -30,7 +30,7 @@ If you have a well phrased question that might benefit others, consider asking i
* Clone the repository recursively, eg: `git clone --recursive https://github.com/purpleidea/mgmt/`.
* Get the remaining golang dependencies on your own, or run `make deps` if you're comfortable with how we install them.
* Run `make build` to get a freshly built `mgmt` binary.
* Run `time ./mgmt run --file examples/graph0.yaml --converged-timeout=1` to try out a very simple example!
* Run `time ./mgmt run --file examples/graph0.yaml --converged-timeout=5 --tmp-prefix` to try out a very simple example!
* To run continuously in the default mode of operation, omit the `--converged-timeout` option.
* Have fun hacking on our future technology!

1
resources/file.go

@ -317,6 +317,7 @@ func (obj *FileRes) Watch(processChan chan event.Event) error {
// we must be a parent watcher, so descend in
if deltaDepth < 0 {
// XXX: we can block here due to: https://github.com/fsnotify/fsnotify/issues/123
obj.watcher.Remove(current)
index++
}

1
vendor/gopkg.in/fsnotify.v1

@ -0,0 +1 @@
Subproject commit 7be54206639f256967dd82fa767397ba5f8f48f5
Loading…
Cancel
Save