-
Notifications
You must be signed in to change notification settings - Fork 229
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
wait until actually stopped to tell windows we are #2040
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
majestrate
reviewed
Oct 27, 2022
majestrate
force-pushed
the
windows-service-issues
branch
from
October 27, 2022 13:19
c2432bd
to
3dbff19
Compare
We should send STOP_PENDING rather than STOPPED while we aren't yet actually stopped; STOPPED is already sent when we actually finish stopping. Also fixes some silly argc/argv shenanigans, I think.
majestrate
force-pushed
the
windows-service-issues
branch
from
October 27, 2022 13:32
3dbff19
to
a9a2a11
Compare
report status to window service manager when we get and iterogate message from the service manager. update comments to reflect these changes.
add an interface type for platform dependant system layer behavior. this gives lokinet a platform agnostic way to inform the system layer of its current state.
- win32_platform.cpp is dead - win32_platform.hpp is useless Style changes from clang-tidy warnings: - remove `virtual` from some definitions that already have `override` - remove virtual destructor from NetworkInterface because it already has a virtual destructor via the base type (and clang-tiny warns about it)
Fixes windows shutdown crashes: - windivert wasn't handling an ERROR_NO_DATA, which it gets when finished handling everything after a shutdown. - wintun ReadPacket still gets invoked after end_session is called, but shouldn't be. This adds an atomic<bool> to early return. - fixes up some settings we send for windows service manager notify
When unbound is in threaded async mode on Windows it crashes in ub_ctx_delete during shutdown for unknown reasons, but only when stopped via windows service control. Switch it to process async mode which doesn't crash.
majestrate
approved these changes
Oct 28, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it works now it looks fine
jagerman
reviewed
Oct 28, 2022
jagerman
reviewed
Oct 28, 2022
If wintun fails it seems to take about 15s, so extend the startup timeout so that it can fail gracefully (and let us clean up before exiting). Also refactors the timeouts to chrono constants.
jagerman
reviewed
Oct 28, 2022
jagerman
reviewed
Oct 28, 2022
jagerman
reviewed
Oct 28, 2022
* remove old compilation unit * move systemd specific parts of status to service manager * make router status not systemd specific
jagerman
reviewed
Oct 28, 2022
use `fmt::join` for lokinet version string in status Co-authored-by: Jason Rhinelander <[email protected]>
jagerman
reviewed
Oct 28, 2022
Get rid of the --win32-daemon hack (which was removed from the service itself earlier in this PR, by mistake) and replace it with detection of the error code for "not running as a service" that windows gives us back if we try to set up service controller dispatching but aren't a service.
we were calling llarp::Context::HandleSignal from a non mainloop thread when running as a win32 service. this caused issues with a non clean destruction. call our signal handler instead of llarp::Context::HandleSignal
This reverts commit 3f23118.
If already below info (e.g. debug) it should stay there; we only want to *lower* it to info if above info.
We do and should be able to call this multiple times during shutdown to signal that we are advancing through shutdown.
Occasionally during shutdown windivert will crash because a thread tries sending after we've called wd::shutdown, which isn't allowed. Add an atomic bool to prevent this.
…ndows-service-issues
… win32 make sure we do not query when we are shutting down
…cause the query is kept alive by it (sometimes)
Query->Cancel() will remove the Query, but that introduces a race condition where unbound may still try to invoke the callback (with a no-longer-valid pointer) if we do it before the ub_ctx_delete call. Move to it afterwards so that we only cancel things that unbound didn't
We need to make a copy here because (see comment).
supplanted by #2045 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We should send STOP_PENDING rather than STOPPED while we aren't yet actually stopped; STOPPED is already sent when we actually finish stopping.
Also fixes some silly argc/argv shenanigans, I think.
TODO: