gui: initialize the SDK on the primary instance only, and fix the resolv.conf log line - #6
Merged
Conversation
…olv.conf log line
Two independent fixes, both found by reading a tester's log bundle rather than
by reading the code.
1. SDK INIT RAN ON EVERY LAUNCH, INCLUDING DUPLICATES.
SdkHost::Initialize() was called before app->run(). GApplication only
decides primary-vs-remote inside run(), so that code executes in every
process that starts -- including a second launch that is about to hand its
arguments to the running instance and exit.
That is not a harmless double-init. Initialize() calls urnet::setLogDir(),
which runs the SDK's glog init: it sweeps the log directory down to a
keep-N budget and rewrites the urnetwork-gui.{INFO,WARNING,ERROR}
symlinks. In the bundle, a second launch deleted three of the seven log
files and left urnetwork-gui.INFO -- the file every "grab the current log"
instruction follows -- pointing at its own 846-byte stub, while the session
that was actually running had a 1.5 MB log the symlink no longer named.
Anyone diagnosing from that log was reading the wrong file. Initialize()
also opens the shared storage directory, which a process about to exit has
no business touching.
Moved into signal_startup, which is emitted on the PRIMARY instance only.
A failure there calls app->quit() instead of returning 1, because by that
point main() has already handed control to run().
2. THE resolv.conf PROBE PRINTED A SELF-REFERENTIAL SYMLINK.
The log line rendered "<path> -> <realpath>" unconditionally. On Arch and
CachyOS /etc/resolv.conf is commonly a REGULAR FILE that systemd-resolved
writes in place rather than a symlink into its runtime directory, so
realpath() returns the path itself and the line came out as
/etc/resolv.conf -> /etc/resolv.conf (resolved's)
which reads as a symlink loop and sent a tester's triage chasing a
misdetection that did not exist. The arrow is now rendered only when the
path actually resolves somewhere else; a regular file and a missing file
each say so. DNS tier selection was always correct -- only this line was
wrong.
Ryanmello07
marked this pull request as ready for review
August 21, 2026 15:39
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.
Two independent fixes, both found by reading a tester's log bundle rather than by
reading the code.
1. SDK init ran on every launch, including duplicates
SdkHost::Initialize()was called beforeapp->run(). GApplication only decidesprimary-vs-remote inside
run(), so that code executes in every process thatstarts — including a second launch that is about to hand its arguments to the
running instance and exit.
That is not a harmless double-init.
Initialize()callsurnet::setLogDir(),which runs the SDK's glog init: it sweeps the log directory down to a keep-N
budget and rewrites the
urnetwork-gui.{INFO,WARNING,ERROR}symlinks. In thebundle, a second launch deleted three of the seven log files and left
urnetwork-gui.INFO— the file every "grab the current log" instruction follows— naming its own 846-byte stub, while the session that was actually running had a
1.5 MB log the symlink no longer pointed at. Anyone diagnosing from that log was
reading the wrong file.
Initialize()also opens the shared storage directory,which a process about to exit has no business touching.
Moved into
signal_startup, which is emitted on the primary instance only. Afailure there calls
app->quit()instead ofreturn 1, because by that pointmain()has already handed control torun().2. The resolv.conf probe printed a self-referential symlink
The log line rendered
<path> -> <realpath>unconditionally. On Arch and CachyOS/etc/resolv.confis commonly a regular file that systemd-resolved writes inplace rather than a symlink into its runtime directory, so
realpath()returnsthe path itself and the line came out as
which reads as a symlink loop and sent a tester's triage chasing a misdetection
that did not exist. The arrow is now rendered only when the path actually
resolves somewhere else; a regular file and a missing file each say so
explicitly.
DNS tier selection was always correct — only this line was wrong. No behaviour
change, only the diagnostic.
Why this is split this way
Neither fix has anything to do with the app id, the icon, packaging or Flathub.
They are grouped only because they are both small runtime-correctness fixes found
in the same testing pass, and both are worth landing without waiting for the
larger PRs.
app/src/main.cppis also touched by PR 2 (the app-id string, ~8 lines above thehunk here). They merged cleanly in testing; if git ever disagrees, keep both.