-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[cmd/opampsupervisor] Make supervisor runnable as Windows service #35275
[cmd/opampsupervisor] Make supervisor runnable as Windows service #35275
Conversation
99b24f9
to
3f57af7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A follow-up adding a basic test similar to https://github.com/open-telemetry/opentelemetry-collector/blob/59c083f830f3b175cd0b89ac1a1bc97c58c4c2d0/otelcol/collector_windows_service_test.go#L40 will be good.
This PR needs |
156a6a3
to
197fd54
Compare
67c4189
to
4eb4c19
Compare
cmd/opampsupervisor/supervisor/supervisor_windows_service_test.go
Outdated
Show resolved
Hide resolved
418ee9b
to
dada525
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unable to review the Windows-related aspects of this PR. Thank you @BinaryFissionGames @djaglowski @pjanotti for your reviews.
I only have one comment; outside of that, once CI is green, I think we're good to merge this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The windows supervisor test is failing with:
Remove-Service: D:\a\_temp\9f7c6c19-fb48-4034-9af3-ba5e031c9de9.ps1:2
Line |
2 | Remove-Service opampsupervisor
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Service 'opampsupervisor' was not found on computer '.'.
Error: Process completed with exit code 1.
Removing "ready to merge" label for now
@dpaasman00 the name of the artifact to be downloaded is wrong. Instead of |
ff1f631
to
5657a8e
Compare
@dpaasman00 Not sure whether you're up to date with main, but I think the build failure that's happening right now will be fixed if you rebase on the latest commit. |
@dpaasman00 I think one of the other Supervisor PRs included changes that conflict with this PR. If you can resolve the conflict, I'll get this merged. |
…ailing tests" This reverts commit c219b8e.
5657a8e
to
c6a8467
Compare
…en-telemetry#35275) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Add support for running supervisor as a Windows Service. Updates entry point to run a service handler if being ran as a Windows Service by implementing the [handler interface](https://pkg.go.dev/golang.org/x/sys/windows/svc#Handler). Also updates the Windows Commander to allocate a console if running as a service. We send a CTRL_BREAK_EVENT console event to the agent to signal a shutdown however windows services do not run with consoles. If running as service we need to allocate a console to send the signal and then free the console. **Link to tracking Issue:** <Issue number if applicable> Closes open-telemetry#34774 **Testing:** <Describe what testing was performed and which tests were added.> - Tested using a windows VM and using `sc.exe` for creating the service **Documentation:** <Describe the documentation added.>
…en-telemetry#35275) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Add support for running supervisor as a Windows Service. Updates entry point to run a service handler if being ran as a Windows Service by implementing the [handler interface](https://pkg.go.dev/golang.org/x/sys/windows/svc#Handler). Also updates the Windows Commander to allocate a console if running as a service. We send a CTRL_BREAK_EVENT console event to the agent to signal a shutdown however windows services do not run with consoles. If running as service we need to allocate a console to send the signal and then free the console. **Link to tracking Issue:** <Issue number if applicable> Closes open-telemetry#34774 **Testing:** <Describe what testing was performed and which tests were added.> - Tested using a windows VM and using `sc.exe` for creating the service **Documentation:** <Describe the documentation added.>
Description:
Add support for running supervisor as a Windows Service. Updates entry point to run a service handler if being ran as a Windows Service by implementing the handler interface.
Also updates the Windows Commander to allocate a console if running as a service. We send a CTRL_BREAK_EVENT console event to the agent to signal a shutdown however windows services do not run with consoles. If running as service we need to allocate a console to send the signal and then free the console.
Link to tracking Issue: Closes #34774
Testing:
sc.exe
for creating the serviceDocumentation: