-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Windows Service Timeout #570
Comments
I think moving declaration to inside each functions makes each function call slower. And so many changes are required. So we can not accept your suggestion for this library. Do you have any other idea ? |
what about the "init" function in each module? so all its just called once |
So you mean like this?
If this works, this is acceptable I think. And one more question. You have mentioned about Dll, but how about LazyProc? |
to be honest, i dont know :D |
Ok, so could you make a PR after you confirm it works on your usage? |
i will try |
I'm surprised this issue would occur in gopsutil because it uses Unless we have some remaining non-LazyDLL/Proc calls remaining in some |
…cking Might be useless because of https://docs.microsoft.com/en-us/windows/desktop/dlls/dynamic-link-library-search-order#search-order-for-desktop-applications but better be safe than sorry. Ref: #570 (comment)
omg it f***ing works :O the windows service do not run in any timeouts anymore!!! :) |
That's… crazy, and a total (happy) side-effect, awesome that it fixed your issue! |
windows.... |
Closing as it looks fixed, don't hesitate to reopen this issue if it happens again. |
I encountered this problem, putting all DLL related initialization actions into init method solves my problem |
Hello, is it possible to move all dll files within a function?
Currently there is a huge bug in golang concerning windows services.
If a golang app is loaded for the first time (after restart) and windows try to load the go app, go do not tell windows that it is ready, instead it loads all dll files and blocks the main thread meanwhile.
This leads (especially on slow hdd disks) to a windows service timeout and the service will not start.
Here is the issue:
golang/go#23479
This bug could be prevented if all dll files will load within a function and not in the global scope.
This problem is really serious for me :(
The text was updated successfully, but these errors were encountered: