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

proposal: x/sys/windows/svc: Add RequestAdditionalTime() #60147

Closed
nolotz opened this issue May 12, 2023 · 1 comment
Closed

proposal: x/sys/windows/svc: Add RequestAdditionalTime() #60147

nolotz opened this issue May 12, 2023 · 1 comment
Labels
Milestone

Comments

@nolotz
Copy link

nolotz commented May 12, 2023

Hello,

I've been working with the Windows Service (svc) package in the golang/sys repository and it has been a great resource so far. However, I've run into a situation where the existing functionality might be enhanced.

In certain scenarios, a Windows Service might need more time to finish its operations before being stopped. If the service doesn't stop in a timely manner, Windows forcibly kills it. To prevent this from happening, the .NET framework provides a RequestAdditionalTime() method which allows a service to request more time for its shutdown operations.

As of now, it seems that this functionality is not available in the Windows Service (svc) package of the golang/sys repository.

Would it be possible to consider the addition of a similar method, possibly called RequestAdditionalTime(), to the svc package? This would greatly help in managing services that require a bit more time to shut down gracefully and it could prevent unwanted service terminations.

Thank you for considering this feature request. I believe it would be a valuable addition to the library and it would provide greater control over the lifecycle of Windows Services.

Looking forward to hearing your thoughts on this.

@gopherbot gopherbot added this to the Proposal milestone May 12, 2023
@nolotz
Copy link
Author

nolotz commented May 12, 2023

Hello again,

After further exploration and testing, I've found that I can achieve the desired outcome by making use of the WaitHint in the StopPending Status. By passing multiple StopPending updates with an appropriate WaitHint, I can effectively request additional time before Windows forcibly terminates the service, similar to how the RequestAdditionalTime() method works in .NET.

In light of this, it seems that the addition of a RequestAdditionalTime() method would primarily serve as a neat wrapper for this process rather than a new, necessary feature.

Given this, I believe it would be appropriate to close the feature request at this time. However, it may be worth considering documenting this process for the benefit of developers who find themselves in similar situations.

Thank you for your time and consideration. I appreciate your commitment to maintaining and enhancing the golang/sys repository.

@nolotz nolotz closed this as completed May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants