Retry tray app initialization upon failure - #26
Merged
Merged
Conversation
ehrenfeu
force-pushed
the
tray-retry-init
branch
from
August 18, 2026 20:17
900b982 to
c2b2418
Compare
ehrenfeu
reviewed
Aug 18, 2026
Tray app failed to start after not finding the correct path. We retry this process a certain number of times, giving it enough time to find the UNC paths.
This is so that it can be called multiple times from `InitialiazeMultipleTimes`. Main lines were taken over directly from v3.1.0 constructor `AtxTray`.
Also add some explanatory comments.
This is a workaround for `Log.Error(string, Exception)`being obsolete.
Previously, the log file was written to baseDir\var, but is not writable in user context.
ehrenfeu
force-pushed
the
tray-retry-init
branch
from
August 19, 2026 12:06
d0b0191 to
f480f74
Compare
Previously, the file landed in \Roaming, which is not optimal.
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.
Issue #25: any failure while reading the config files or finding necessary paths would lead to the exit of the initialization of the tray app. This behaviour was noticed on production machines with the
TmpTransferDirnot being found on user login, and the subsequent exit of the tray app.This PR touches only
ATxTray/AutoTxTray.cs, so the deployment is limited just toAtxTray.exe.🐛 Additions:
TryInitialize(): extracted from the constructor, and made into its own method. Tries to read config, deserialize and create the file system watcher. Returnstrueif it was successful,falseotherwise.InitializeWithRetries(): repeats the attempt up toMaxInitAttempts, with a pause between attempts (SecondsBetweenAttempts)_initialized, replacing_status. If this is false, the start up is exited gracefully.AtxTray.logfile in thebaseDir\var\directory; previously this was a relative path related to the executable, but this doesn't help due to the following caveat:Note: logs for
AtxTraycannot be written by user accounts, as writing toC:\is disabled for these. Will need a workaround here to monitor the changes, as this bug cannot be reliably reproduced - I had it happen once during testing, but this is not quite enough.Testing
This version was build using Visual Studio, and
AtxTray.exewas deployed on machines running AutoTx. A fake, broken configuration file was written with wrong paths, where the Tray app retried initialization multiple times. On a different run, the path was corrected manually during retries, after which the app was able to initialize correctly.