fix(#1352): moving the stop signal after svc.Run() #1379
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As explained in the closed PR #1372 this would be the shorthand fix for #1352.
Just to mention that @jkroepke suggested the it would be better to split the windows service stuff from the exporter itself and create two binaries. Like it is done in the grafana/agent#3243 I also agree with that but this would be a bigger change and take more time to implement which I don't have at the moment.
So in the meantime this PR could fix the stop error and since there is only e little change in when the stop signal is sent, it should not re interduce some old behavior/issues like #1047 or #551.
I have tested this PR with default collectors enabled and windows 11 and windows server 2016 (I don't have more options just yet)