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

Graceful stop in repeat mode - part 1 #857

Merged
merged 2 commits into from
Feb 18, 2023
Merged

Conversation

tleedjarv
Copy link
Contributor

Split off from #833

Parse and validate [Uicommon.repeat] at preference parsing instead of
letting the code using the value interpret it freely and possibly error
out very late in the process.

Restructure the code in text UI to better align with this new preference
representation and make it easier to expand in future.
The repeat mode is basically an endless loop. It will run until the
process is terminated or a fatal error occurs. Currently the only way
for the user to stop repeat mode is to interrupt the process by pressing
Ctrl-C or sending a signal that terminates or kills the process. This
works but is not satisfactory if the delay between repeated syncs is
very short (using fsmonitor on a busy root, for example). The chance of
interrupting the process cleanly between syncs becomes very slim.

Add a new way to stop repeat mode and do so cleanly. A stop can be
requested (in this commit the request method is the signal SIGUSR2) by
the user at any time and Unison decides when it is safe to act on that
request. Any ongoing sync is allowed to run to completion. This way it
is guaranteed that the process terminates between syncs.
@gdt gdt merged commit ea21b91 into bcpierce00:master Feb 18, 2023
@tleedjarv tleedjarv deleted the fix-554-part1 branch February 18, 2023 15:18
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.

2 participants