Skip to content

Fix deadlock when watching files with inotify#76

Merged
Nino-K merged 3 commits intohpcloud:masterfrom
aristanetworks:upstream
Apr 8, 2016
Merged

Fix deadlock when watching files with inotify#76
Nino-K merged 3 commits intohpcloud:masterfrom
aristanetworks:upstream

Conversation

@tsuna
Copy link
Copy Markdown
Contributor

@tsuna tsuna commented Mar 1, 2016

Calling watcher.Remove() from the run() goroutine is now problematic, because with the change made in fsnotify/fsnotify#73 Remove() can now take an arbitrary amount of time, which means we can deadlock if run() is waiting for fsnotify to acknowledge the removal and fsnotify is trying to send an unrelated Event.

So instead we now do part of the cleanup, including calling watcher.Remove(), synchronously, in the goroutine trying to unsubscribe.

This fixes #75. Thanks to @aaronbee for the fix.

tsuna added 3 commits March 1, 2016 10:05
Calling watcher.Remove() from the run() goroutine is now problematic,
because with the change made in fsnotify/fsnotify#73 Remove() can now
take an arbitrary amount of time, which means we can deadlock if run()
is waiting for fsnotify to acknowledge the removal and fsnotify is
trying to send an unrelated Event.

So instead we now do part of the cleanup, including calling Remove(),
synchronously, in the goroutine trying to unsubscribe.

This fixes hpcloud#75.  Thanks to Aaron Beitch for the fix.

Change-Id: I346c9eecc34b2378312b07b3c3efc41616b95380
Change-Id: I0f9b88fc327b169c748794e86efb0aa0a03b3e2a
Change-Id: Ic744312efa91cf5c2dc2810e597353a080dccb70
@Nino-K
Copy link
Copy Markdown
Contributor

Nino-K commented Apr 8, 2016

@tsuna Thanks for you contribution, your PR is now merged.

@Nino-K Nino-K merged commit adca23e into hpcloud:master Apr 8, 2016
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

Successfully merging this pull request may close these issues.

deadlock when watching files with inotify with recent fsnotify changes

2 participants