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

Improvements to signal handling #2379

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

fridrik01
Copy link
Contributor

@fridrik01 fridrik01 commented Jan 19, 2025

This PR makes the following improvements to signal handling, where during graceful shutdown we now:

  • only stops services which we called Start() on.
  • fixes critical section issue where we can call StopAll twice during shutdown if signal was received while in the middle of Startup.
  • only call StopAll during signal handling as that is the only way to stop the service
  • simplifies the signal handling to use a simple blocking channel
  • call panic if we can't shutdown within receiving 10x SIGTERM signals.

@fridrik01 fridrik01 self-assigned this Jan 19, 2025
Copy link

codecov bot commented Jan 19, 2025

Codecov Report

Attention: Patch coverage is 20.51282% with 31 lines in your changes missing coverage. Please review.

Project coverage is 26.60%. Comparing base (dddd9d2) to head (723a417).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
node-core/node/node.go 0.00% 22 Missing ⚠️
node-core/services/registry/registry.go 47.05% 9 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2379      +/-   ##
==========================================
+ Coverage   26.57%   26.60%   +0.03%     
==========================================
  Files         348      348              
  Lines       15499    15496       -3     
  Branches       20       20              
==========================================
+ Hits         4119     4123       +4     
+ Misses      11178    11171       -7     
  Partials      202      202              
Files with missing lines Coverage Δ
node-core/services/registry/registry.go 48.71% <47.05%> (-2.03%) ⬇️
node-core/node/node.go 0.00% <0.00%> (ø)

@fridrik01 fridrik01 force-pushed the fix-signal-handling branch from 947fb93 to 836aa5d Compare January 19, 2025 21:56
@fridrik01 fridrik01 changed the title improve signal handling Improvements to signal handling Jan 20, 2025
@fridrik01 fridrik01 marked this pull request as ready for review January 20, 2025 20:04
@fridrik01 fridrik01 requested a review from a team as a code owner January 20, 2025 20:04
@fridrik01 fridrik01 force-pushed the fix-signal-handling branch from 39da828 to 723a417 Compare January 23, 2025 14:48
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.

1 participant