Skip to content
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

ServiceController.WaitForStatus could use NotifyServiceStatusChange WinAPI to avoid polling #45049

Open
Fs00 opened this issue Nov 21, 2020 · 0 comments
Labels
area-System.ServiceProcess help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@Fs00
Copy link
Contributor

Fs00 commented Nov 21, 2020

Currently, ServiceController WaitForStatus method polls every 250ms to check if the service has reached the desired status.
This is not optimal and also not very performant, particularly if the service takes less than 250ms to reach that status.
Apparently lost in the mists of time, there was a plan to use the WinAPI function NotifyServiceStatusChange to avoid polling and get instantly notified when the service reaches a specific status.

I'm opening this issue to prevent this potential improvement from getting lost again.

Props to @KalleOlaviNiemitalo for finding this.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.ServiceProcess untriaged New issue has not been triaged by the area owner labels Nov 21, 2020
@Anipik Anipik added this to the Future milestone Nov 24, 2020
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jan 13, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Mar 31, 2021
@jeffschwMSFT jeffschwMSFT removed the untriaged New issue has not been triaged by the area owner label Jul 8, 2021
@danmoseley danmoseley added the help wanted [up-for-grabs] Good issue for external contributors label Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.ServiceProcess help wanted [up-for-grabs] Good issue for external contributors
Development

Successfully merging a pull request may close this issue.

5 participants