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

Allow network transfer of snapshot to be cancelled during shutdown #585

Open
mauri870 opened this issue Feb 28, 2024 · 0 comments · May be fixed by #588
Open

Allow network transfer of snapshot to be cancelled during shutdown #585

mauri870 opened this issue Feb 28, 2024 · 0 comments · May be fixed by #588

Comments

@mauri870
Copy link

mauri870 commented Feb 28, 2024

We were discussing an issue in rqlite/rqlite#1695 where a raft.Shutdown() prevents the program from exiting, since it is in the middle of a network transfer of the snapshot. If said snapshot is in the order of gigabytes this transfer step can take a long time.

Looking at the source code, it seems that raft blocks during the network transfer and does not check the shutdownCh channel to quit if a shutdown was initiated. There is a check for the shutdown signal in the restore future, but that happens after the transfer operation takes place.

I have a proposed fix here, I would be happy to submit a PR if it makes sense.

Another option would be to convert the network transfer into a future, but that may not be necessary.

@mauri870 mauri870 linked a pull request Mar 7, 2024 that will close this issue
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 a pull request may close this issue.

1 participant