Repository navigation
windows: use/accept platform-specific signal for stopping agent - #26780
Conversation
b6d5e68 to
fd6c101
Compare
fd6c101 to
c00484e
Compare
c00484e to
b17abc2
Compare
|
I've been doing some testing and discovered that on Windows the signal handler is also ignoring If we call |
b17abc2 to
3954a16
Compare
3954a16 to
7223f9a
Compare
7223f9a to
ccb00c1
Compare
|
@chrisroberts discovered that we needed to call |
On Windows, the `os.Process.Signal` method returns an error when sending `os.Interrupt` (SIGINT) because it isn't implemented. This causes test servers in the `testutil` packages to break on Windows. Use the platform specific syscalls to generate the SIGINT instead. The agent's signal handler also did not correctly handle the Ctrl-C because we were masking os.Interrupt instead of SIGINT. Fixes: #26775 Co-authored-by: Chris Roberts <croberts@hashicorp.com>
ccb00c1 to
55c12e6
Compare
jrasell
left a comment
There was a problem hiding this comment.
LGTM and although the Windows stuff looks a little magical to me, it seems to track given what I've read in this PR, the issue, and on the Microsoft learn website about the functions.
|
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
On Windows, the
os.Process.Signalmethod returns an error when sendingos.Interrupt(SIGINT) because it isn't implemented. This causes test servers in thetestutilpackages to break on Windows. Use the platform specific syscalls to generate the SIGINT instead.The agent's signal handler also did not correctly handle the Ctrl-C because we were masking
os.Interruptinstead of SIGINT.Fixes: #26775
Contributor Checklist
changelog entry using the
make clcommand.ensure regressions will be caught.
and job configuration, please update the Nomad website documentation to reflect this. Refer to
the website README for docs guidelines. Please also consider whether the
change requires notes within the upgrade guide.
Reviewer Checklist
backporting document.
in the majority of situations. The main exceptions are long-lived feature branches or merges where
history should be preserved.
within the public repository.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.