From 5025f8293cb0721672a6f37d6633263df68f4659 Mon Sep 17 00:00:00 2001 From: yusufipk Date: Sun, 16 Aug 2026 11:47:40 +0300 Subject: [PATCH] Describe the restart race as what it is, not as what it is not The comment claimed the new process would take itself for the second copy and hand its command over. That is the command line's path, through cli.run and ipc.send; run_app with --gui never asks whether anything is already running, it calls listen() and prints if that fails. The change is the same one either way: two processes asking for one name is either two servers answering on it or a listen that fails into a console nobody reads, and closing first leaves neither. --- dikte.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dikte.py b/dikte.py index d777206..cc1eb47 100755 --- a/dikte.py +++ b/dikte.py @@ -906,9 +906,12 @@ class Dikte: self.shutdown() # Stop answering before the replacement is started, not just afterwards. # execv leaves nothing behind to answer, but a Windows restart is two - # processes for a moment, and a new one that reached a server still - # listening would take itself for the second copy, hand its command over - # and exit, leaving nothing running at all. + # processes for a moment, and removeServer does nothing about a name + # another process is holding. The new one then either opens a second + # server on a name the old one is still answering on, so that a command + # arriving in that moment reaches the process that is going away, or + # fails to open one at all and says so to a console nobody is watching. + # Closing first leaves neither. if self.server is not None: self.server.close() QLocalServer.removeServer(SERVER_NAME)