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

Review and refactor services start and shutdown processes #2568

Closed
AnnaShaleva opened this issue Jun 28, 2022 · 1 comment · Fixed by #2580
Closed

Review and refactor services start and shutdown processes #2568

AnnaShaleva opened this issue Jun 28, 2022 · 1 comment · Fixed by #2580
Milestone

Comments

@AnnaShaleva
Copy link
Member

For each node service (consensus, RPC server, notary service, etc.) we need to ensure that:

  1. Double-call to Start doesn't hurt service. Usually it can be done via checking isStarted atomic variable.
  2. Double-call to Shutdown doesn't hurt the service. Usually it can be done via checking isStarted and isFinished atomic variables.
  3. Service is waiting until all its processes are finished before it returns from Shutdown. Usually it can be done via using two channels: shutdownchannel is used to send a signal to the main service loop to start shutdown process and quit channel is used inside the Shutdown method to wait until main service loop is finished and closes quit.

Not all services follow these rules which can cause problems with #1949 and long-term node functionality support.

@AnnaShaleva AnnaShaleva changed the title Review and refactor services shutdown process Review and refactor services start and shutdown processes Jun 28, 2022
@AnnaShaleva
Copy link
Member Author

Related to #2566.

@roman-khimov roman-khimov added this to the v0.99.1 milestone Jul 4, 2022
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.

2 participants