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

Sync state tolerance #2725

Merged
merged 1 commit into from Mar 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion sanic/worker/manager.py
Expand Up @@ -312,6 +312,10 @@

def _sync_states(self):
for process in self.processes:
state = self.worker_state[process.name].get("state")
try:
state = self.worker_state[process.name].get("state")
except KeyError:
process.set_state(ProcessState.TERMINATED, True)
continue

Check warning on line 319 in sanic/worker/manager.py

View check run for this annotation

Codecov / codecov/patch

sanic/worker/manager.py#L317-L319

Added lines #L317 - L319 were not covered by tests
if state and process.state.name != state:
process.set_state(ProcessState[state], True)