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

Wait for new process to ACK before termination of old on restart #2623

Closed
wants to merge 10 commits into from

Conversation

ahopkins
Copy link
Member

@ahopkins ahopkins commented Dec 8, 2022

Current logic terminates a process (sends SIGINT), then starts a new process. This PR reverses the order so that it starts the new process, waits for ACK and then sends the SIGINT.

Closes #2619

@ahopkins ahopkins marked this pull request as ready for review December 12, 2022 09:26
@ahopkins ahopkins requested a review from a team as a code owner December 12, 2022 09:26
with caplog.at_level(DEBUG):
worker_process.restart()

ansi = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")

Check warning

Code scanning / CodeQL

Overly permissive regular expression range

Suspicious character range that is equivalent to \[@A-Z\].
with caplog.at_level(DEBUG):
worker_process.restart()

ansi = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")

Check warning

Code scanning / CodeQL

Overly permissive regular expression range

Suspicious character range that is equivalent to \[0-9:;<=>?\].
@codecov
Copy link

codecov bot commented Dec 12, 2022

Codecov Report

Base: 88.568% // Head: 88.483% // Decreases project coverage by -0.085% ⚠️

Coverage data is based on head (f83553b) compared to base (92e7463).
Patch coverage: 95.081% of modified lines in pull request are covered.

Additional details and impacted files
@@              Coverage Diff              @@
##              main     #2623       +/-   ##
=============================================
- Coverage   88.568%   88.483%   -0.086%     
=============================================
  Files           81        81               
  Lines         6631      6660       +29     
  Branches      1129      1135        +6     
=============================================
+ Hits          5873      5893       +20     
- Misses         522       527        +5     
- Partials       236       240        +4     
Impacted Files Coverage Δ
sanic/worker/process.py 89.565% <91.666%> (+0.801%) ⬆️
sanic/application/ext.py 100.000% <100.000%> (ø)
sanic/config.py 97.402% <100.000%> (+0.051%) ⬆️
sanic/constants.py 100.000% <100.000%> (ø)
sanic/log.py 100.000% <100.000%> (ø)
sanic/mixins/startup.py 90.909% <100.000%> (+0.020%) ⬆️
sanic/worker/manager.py 93.442% <100.000%> (+0.522%) ⬆️
sanic/app.py 89.071% <0.000%> (-0.729%) ⬇️
sanic/server/websockets/impl.py 37.788% <0.000%> (-0.692%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ahopkins ahopkins marked this pull request as draft December 14, 2022 18:21
@ahopkins
Copy link
Member Author

Going to put this on hold until #2626 is in. Using the new pattern there, we can remove this from a config setting and do it as a command feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

restart workers online (graceful restart) to hot reload, in production environment.
1 participant