Auto-restarting in the background

I have been looking into having the back-end auto restart when needed instead of figuring out how to not require the restart. I have come across two good ways to accomplish this.

  1. Restart the back-end automatically when the back-end saves the config. Pro: Really fast, not noticeable to the user at all. Con: If something goes wrong, it will look like syncthing just crashed and stopped working for no reason.

  2. Have the front-end automatically issue the restart request rather than asking the user to press “restart”. Pro: User is notified about what is happening. Con: User must wait until the “restarting” prompt goes away.

I have already implemented both methods to test them out and I personally prefer number 1, but in the event something does go wrong… it might not be too good for the average user.

There is a third option which would require a bit more work. Either use method 1 or 2 (doesn’t matter), but indicating to the user in the interface that the back-end is restarting using a non modal message so the user can go about their business. And then auto-dismissing the notification when the system is back up.

No matter what I believe there should be a toggle in the setting to turn auto-restarting on or off, but then what should the default be?

What are everyone’s thoughts? Is this a good idea or compromise for those who don’t want to deal with the restarting message? Will this make the interface better or worse for the average user? Should the work get put into making the app not need a restart at all? etc.

And of course which method do you think would be best if this was implemented and why?

In the long run, we should probably try to avoid restarting. For many things that would probably work already with minimal work - doing the mechanisms for sorting out what requires restart and what doesn’t might be more work.

The only thing I dislike with an auto-restart is that it might interrupt a transfer that was for some reason important to get finished.

I could see going with alternative number two, with it being off by default. The “Restart” box would pop up the first time it’s necessary, and could offer a “[ ] Restart automatically on save” or something checkbox directly in the same dialog? Not sure if we still want to show the “Restarting…” box on save then though.

1 Like

Does the restart results in a re-transfer the initial .idx.gz file from every repo to every node ?

Thats a very good point which I had not thought about. Interrupting file transfers would not be preferable at all. I’ll continue down the path to weed out what settings actually require a restart.