Skip to content

chore(validator): enable signal handling for Windows #531

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

Merged
merged 2 commits into from
Jun 13, 2025

Conversation

zaharidichev
Copy link
Member

This change modifies the signal handling in the network validator in order to enable it to run on Windows

Signed-off-by: Zahari Dichev [email protected]

@zaharidichev zaharidichev requested a review from a team as a code owner June 12, 2025 13:44
Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! (and funny how windows does signal handling as if it were keyboard events 🤷 )
Another nit: given the signal handlers do their own termination via error!, I think the exit(UNSUCCESSFUL_EXIT_CODE) in the handle_signals() branch, will never get executed.

}
_ = sigterm.recv() => {
error!("Killed by SIGTERM");
// Signal handling
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: are these two comments supposed to go together?

Signed-off-by: Zahari Dichev <[email protected]>
@zaharidichev
Copy link
Member Author

Another nit: given the signal handlers do their own termination via error!, I think the exit(UNSUCCESSFUL_EXIT_CODE) in the handle_signals() branch, will never get executed.

@alpeb not sure I get that. tracing::error! just logs an error. It does not terminate the program. Am I getting that wrong?

@alpeb
Copy link
Member

alpeb commented Jun 13, 2025

@alpeb not sure I get that. tracing::error! just logs an error. It does not terminate the program. Am I getting that wrong?

My bad, you're right!

@zaharidichev zaharidichev merged commit 90a0446 into main Jun 13, 2025
5 checks passed
@zaharidichev zaharidichev deleted the zd/support-windows-signals branch June 13, 2025 16:07
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