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

Fix/shutdown race #897

Merged
merged 4 commits into from
Sep 28, 2021
Merged

Fix/shutdown race #897

merged 4 commits into from
Sep 28, 2021

Conversation

ersonp
Copy link
Contributor

@ersonp ersonp commented Sep 28, 2021

Did you run make format && make check?
yes

Fixes #890

Changes:

  • Added mutex lock to DeleteEntry and updated mutex comment.
  • Added stopOnce for Stop() in service updater to fix this.
  • Added debug logs to DeleteEntry and RegisterEntry.

How to test this PR:

  1. Start the visor ./skywire-visor skywire-config.json
  2. Wait for the start to complete and close it with Ctrl+C
  3. See if there is no datarace.

Add mutex lock to DeleteEntry in servicedisc to fix the datarace
The comment was updated to reflect the changes.
Stop() of service updater is called from two places so stopOnce sync.Once was added as we only need to stop it once.
Debug logs added to DeleteEntry() and RegisterEntry() in servicedisc.
@ersonp ersonp marked this pull request as ready for review September 28, 2021 10:49
@jdknives jdknives merged commit 42a9d6f into skycoin:develop Sep 28, 2021
@ersonp ersonp deleted the fix/shutdown-race branch April 11, 2022 15:39
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