mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
44d30c83bf
This slightly changes the interface used for committing configuration changes. The two parts are now: - VerifyConfiguration, which runs synchronously and locked, and can abort the config change. These callbacks shouldn't *do* anything apart from looking at the config changes and saying yes or no. No change from previously. - CommitConfiguration, which runs asynchronously (one goroutine per call) *after* replacing the config and releasing any locks. Returning false from these methods sets the "requires restart" flag, which now lives in the config.Wrapper. This should be deadlock free as the CommitConfiguration calls can take as long as they like and can wait for locks to be released when they need to tweak things. I think this should be safe compared to before as the CommitConfiguration calls were always made from a random background goroutine (typically one from the HTTP server), so it was always concurrent with everything else anyway. Hence the CommitResponse type is gone, instead you get an error back on verification failure only, and need to explicitly check w.RequiresRestart() afterwards if you care. As an added bonus this fixes a bug where we would reset the "requires restart" indicator if a config that did not require restart was saved, even if we already were in the requires-restart state. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3386 |
||
---|---|---|
.. | ||
stbench | ||
stcompdirs | ||
stdisco | ||
stdiscosrv | ||
stevents | ||
stfileinfo | ||
stfinddevice | ||
stgenfiles | ||
stindex | ||
strelaypoolsrv | ||
strelaysrv | ||
stsigtool | ||
stvanity | ||
stwatchfile | ||
syncthing | ||
todos | ||
.gitignore |