You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
The monitor process handles multiple different concerns:
Restarts, in that the main syncthing process can exit with a certain exit code and get restarted
Crashes, in that the main syncthing process will get restarted
Crash reporting, both storing the crash from above and sending it to the mothership when enabled.
If the restart behavior is undesired the monitor process can be disabled by env var or startup switch.
However, we could just always use the monitor process for crash tracking and when given one of the flags as above exit afterwards, letting whoever is monitoring us see the restart happening.
Not if the monitor handles signals and terminates the child correctly (except SIGKILL, but when you use that you asked for it). It already does that today I think.
I know for a fact android uses sigkill after some time, and having runaway processes there would be terrible as they would kill the battery. There is prctl P_DEATHSIG on linux tho, or we could just poll for ppid/some pipe being open and blow up when it changes.
Why do you think Android would only send sigkill to the monitor process, if this is something it does to kill off background things and save battery? But even if that's the case, then Android can be a special case and run without monitor...
The reason that SyncTrayzor doesn't use the monitor process is upgrades. When Syncthing upgrades itself, the monitor process spawns the new version of the monitor process and then exits. SyncTrayzor then loses control of the monitor process.
I'm good with anything so long as this problem isn't re-introduced.
I guess with a hypothetical mandatory monitor process, automatic upgrades, and setting STNORESTART=1 like you do now, both the real syncthing process and then the monitor process would simply exit when it wants to restart after upgrade. So from my point of view you should not notice any difference.
Audrius, for the sigkill case I guess it would break if you are indeed the one sending sigkill to just the child (of the android wrapper). I don’t think it’s possible to solve this from the child process (of the monitor) as presumably it’s already wedged hard for whatever reason or we wouldn’t be in sigkill land. The solution would be to send sigkill to the entire process group, like the shell does. (I don’t know offhand how to do that.)
Then again I'm not sure when this would be necessary. Syncthing used to exit quickly, at least until we introduced the database close recently. :) And there you are arguing that even a soft exit is potential database corruption, so arguing for a ten second sigkill seems odd.
Yeah, OK. I guess my point is that once you start sending SIGKILL it's all in the senders responsibility to clean up properly because agency is removed from the receiver. This goes for everything from separate processes to lock files and whatnot. In the Android case, if this is something that needs to happen, we can tweak the wrapper to accomodate.
enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Activity
AudriusButkevicius commentedon Jun 11, 2019
It breaks killing the proccess tho, as in most cases the child will get disowned.
imsodin commentedon Jun 11, 2019
Not if the monitor handles signals and terminates the child correctly (except SIGKILL, but when you use that you asked for it). It already does that today I think.
calmh commentedon Jun 11, 2019
We handle a normal (soft) kill correctly. For a SIGKILL, yeah, you need to target all the processes. (Or the process group that we set up.)
AudriusButkevicius commentedon Jun 11, 2019
I know for a fact android uses sigkill after some time, and having runaway processes there would be terrible as they would kill the battery. There is prctl P_DEATHSIG on linux tho, or we could just poll for ppid/some pipe being open and blow up when it changes.
calmh commentedon Jun 12, 2019
Why do you think Android would only send sigkill to the monitor process, if this is something it does to kill off background things and save battery? But even if that's the case, then Android can be a special case and run without monitor...
AudriusButkevicius commentedon Jun 12, 2019
Android wrapper sends term, if that doesn't exit in 10s, then sends a kill.
canton7 commentedon Jun 12, 2019
The reason that SyncTrayzor doesn't use the monitor process is upgrades. When Syncthing upgrades itself, the monitor process spawns the new version of the monitor process and then exits. SyncTrayzor then loses control of the monitor process.
I'm good with anything so long as this problem isn't re-introduced.
calmh commentedon Jun 12, 2019
AudriusButkevicius commentedon Jun 12, 2019
I am not arguing for sigkill, I am declaring how it works, and arguing that there might be other cases like that.
calmh commentedon Jun 12, 2019
Yeah, OK. I guess my point is that once you start sending SIGKILL it's all in the senders responsibility to clean up properly because agency is removed from the receiver. This goes for everything from separate processes to lock files and whatnot. In the Android case, if this is something that needs to happen, we can tweak the wrapper to accomodate.
cmd/syncthing: Always use monitor process (fixes syncthing#4774, fixes …
cmd/syncthing: Always use monitor process (fixes syncthing#4774, fixes …
cmd/syncthing: Always use monitor process (fixes syncthing#4774, fixes …
Merge branch 'master' into db/trans
Merge branch 'master' into badgermerge
Merge branch 'master' into encryption