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

Handle fatal watch errors gracefully #5697

imsodin opened this issue May 8, 2019 · 1 comment


None yet
2 participants
Copy link

commented May 8, 2019

Syncthing panics if it receives events outside of the folder root. I did that on the incorrect assumption that the notify library does in some form canonicalize all involved paths. However they only do that for internal housekeeping, paths passed to and received from the underlying filesystem watching interfaces are not touched. They even mention that some implementations change the path in certain situations. I have no intention to find out what all the underlying implementations do. So the sane thing is to report a verbose error if an out-of-root path is encountered and potentially stop watching. And then we can try to find out what the special case is and mitigate that in filesystem.Watch in a next release, while the user still has a working Syncthing (as opposed to a panicking one).

@imsodin imsodin added the enhancement label May 8, 2019


This comment has been minimized.

Copy link

commented May 9, 2019

On the gracefulness side, handling this by doing a full scan when it happens would probably be the most graceful - if it only happens very occasionally. I don't want to propose something too complex and I'm not sure how to do it without complexity, but it would be nice if we just "swallowed" the occasional oddness, but warn and stop watching if the oddness becomes overwhelming.

imsodin added a commit to imsodin/syncthing that referenced this issue May 19, 2019

imsodin added a commit to imsodin/syncthing that referenced this issue May 19, 2019

@calmh calmh added this to the v1.2.0 milestone May 27, 2019

calmh added a commit to calmh/syncthing that referenced this issue May 29, 2019

Merge branch 'master' into crashrep
* master:
  lib/config: Refactor migrations a bit (syncthing#5750)
  lib/connections: Add QUIC protocol support (fixes syncthing#5377) (syncthing#5737)
  github: Create (syncthing#5749)
  gui, man, authors: Update docs, translations, and contributors
  golang-ci: Disable confused scopelint check
  lib/protocol: Don't send anything else before cluster config (syncthing#5741)
  lib/model: Unflake folder restart with blocking conn test (ref syncthing#5707) (syncthing#5744)
  lib/fs, lib/model: Add error channel to Watch to avoid panics (fixes syncthing#5697) (syncthing#5734)
  lib/protocol: Don't call receiver after calling Closed (fixes syncthing#4170) (syncthing#5742)
  lib/model: Readd special handling of conn close in TestIssue5063 (syncthing#5743)
  lib/model: Close connections when model is stopped (syncthing#5733)
  lib/protocol: Test for Close on blocking send deadlock (ref syncthing#5442) (syncthing#5732)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.