Repository navigation
refactor: arbitrate the single instance before the bootstrap - #984
Merged
Merged
Conversation
AppInstanceStartupMessage.CreateFrom wrote a verbose diagnostic, which read UserPreferences.Current and therefore usersettings.json. A secondary instance built its payload through it and lost the diagnostic on exit. The diagnostic moves to AppWindow, the only caller in the primary.
A secondary process now forwards its startup arguments and exits before any directory setup, bootstrap service or host exists. - BravoSingleInstance.ClaimOrRedirect claims the pipe or redirects, right after the exception handler is installed. - Program.Main owns the SingleInstanceServer and releases it last; the host receives it as an existing instance. - BravoApplicationInstance only raises activation events and is registered as IInstanceEvents; IBravoApplicationInstance is removed. - A redirect failure is logged to the Event Log only, through a logger factory with the Event Log provider alone; no telemetry, since consent needs the bootstrap. AddBravoEventLog keeps the Event Log setup shared with the bootstrap logger factory. - InstancePipeName reads the session from the process, not AppEnvironment.
This file contains hidden or 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
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.
A secondary Bravo process now forwards its startup arguments to the primary
and exits before any directory setup, bootstrap service (logger factory,
policies, settings, telemetry) or host exists.
BravoSingleInstance.ClaimOrRedirectruns right after the exceptionhandler: it claims the pipe or redirects the activation.
Program.Mainowns theSingleInstanceServerand releases it last, afterthe bootstrap services; the host receives it as an existing instance.
BravoApplicationInstanceonly raises activation events and is registeredas
IInstanceEvents;IBravoApplicationInstanceis removed.usersettings.json.in telemetry: consent needs the bootstrap, which a secondary never builds.
The user-facing message comes in a later change.
lost, because the pipe is held until the bootstrap services are disposed.
Docs: architecture.md (ownership, single-instance contract), diagnostics.md
(startup coverage), ADR 0004 (consequences).