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

readdcw: Fix unwatching at the same time as incoming event #126

Closed
wants to merge 12 commits into from
Closed

readdcw: Fix unwatching at the same time as incoming event #126

wants to merge 12 commits into from

Conversation

imsodin
Copy link
Contributor

@imsodin imsodin commented Aug 27, 2017

Scenario:
Stop a watch at the same time as an event is created (in original case: file removed). Then Watch it again. After that no more events are generated and calling Stop again returns an error.

I added some debug statements (see diff). In the following log the first time Stop works fine, the second time it fails and then no more events are registered even though files are created and Stop fails.

2017/08/27 14:35:08.535964 [D] Stop(0xc04203aea0) error: <nil>
2017/08/27 14:35:08.535964 [D] loopstate: stateUnwatch
2017/08/27 14:35:09.950001 [D] dispatching notify.FileActionRenamedOldName on "C:\\Temp\\syncthing-d3d5715d\\src\\github.com\\syncthing\\syncthing\\lib\\fswatcher\\temporary_test_fswatcher\\oldfile"
2017/08/27 14:35:09.950001 [D] dispatching notify.FileActionRenamedNewName on "C:\\Temp\\syncthing-d3d5715d\\src\\github.com\\syncthing\\syncthing\\lib\\fswatcher\\temporary_test_fswatcher\\newfile"
2017/08/27 14:35:13.651173 [D] Stop(0xc04203b500) error: <nil>
2017/08/27 14:35:13.653176 [D] dispatching notify.FileActionRemoved on "C:\\Temp\\syncthing-d3d5715d\\src\\github.com\\syncthing\\syncthing\\lib\\fswatcher\\temporary_test_fswatcher\\newfile"
2017/08/27 14:35:16.366990 [D] Stop(0xc04203b980) error: notify: another re/unwatching operation in progress

I already found a fix, but would like to see whether the test can reproduce the error first.

@imsodin
Copy link
Contributor Author

imsodin commented Aug 27, 2017

As I was suspecting I cannot reproduce this, it probably depends heavily on the host system. I will close this and open a new PR with my proposed fix.

@imsodin imsodin closed this Aug 27, 2017
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.

1 participant