-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
runtime: Windows service lifecycle events behave incorrectly when called within a golang environment [1.14 backport] #40411
Comments
Change https://golang.org/cl/242280 mentions this issue: |
Change https://golang.org/cl/244957 mentions this issue: |
Change https://golang.org/cl/244958 mentions this issue: |
Sorry for the churn. Please consult only https://golang.org/cl/244958 |
@dmitshur sorry to bother you, but we need this to be approved to be backported to go1.14. Can you help with that? If not, do you know who can approve it? Thank you. Alex |
Thanks, we’ll try to take a look at this request next week. For programs where it’s critical to receive stop / shutdown event, do you know if there is a workaround that can be used until this issue is resolved? I’ve also asked a question on the upstream issue about 1.13 since that affects the 1.14 backport. |
Sounds good. Thank you.
I don't know a workaround. Maybe others have good suggestions. Alex |
Pinging @dmitshur - we would like the approval of this change to be back-ported. Thank you. Alex |
Approved per discussion in a release meeting. This is fixing a serious issue without a workaround. This backport applies to both 1.15 (#40412) and 1.14 (this issue). |
The fix is at https://go-review.googlesource.com/c/go/+/244958/ and gave it +2. How do we get it submitted (my submit button is disabled)? Thank you. Alex |
Closed by merging 7456a46 to release-branch.go1.14. |
The service handler needs to handle CTRL+C-like events -- including those sent by the service manager itself -- using the default Windows implementation if no signal handler from Go is already listening to those events. Ordinarily, the signal handler would call exit(2), but we actually need to allow this to be passed onward to the service handler. So, we detect if we're in a service and skip calling exit(2) in that case, just like we do for shared libraries. Updates #40167. Updates #40074. Fixes #40411. Change-Id: Ia77871737a80e1e94f85b02d26af1fd2f646af96 Reviewed-on: https://go-review.googlesource.com/c/go/+/244958 Run-TryBot: Jason A. Donenfeld <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Alex Brainman <[email protected]>
@alexbrainman requested issue #40167 to be considered for backport to the next 1.14 minor release.
The text was updated successfully, but these errors were encountered: