<table><tr><td style="">sitter created this revision.<br />Herald added a project: Frameworks.<br />Herald added a subscriber: kde-frameworks-devel.<br />sitter requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D20078">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>When kcrash is set to auto restart Unique service processes we have<br />
potential for a race. Because KCrash will want to ideally restart through<br />
kdeinit it only closes the crashed process' sockets after it issues<br />
the restart. Depending on timing the new process may then attempt to<br />
register its service name while the crashed process is still holding the<br />
name. As a result the new process will not actually start because it'll<br />
fail to claim the name.</p>

<p>To mitigate this problem, service registration now will wait for a bit<br />
iff the service name cannot be registered and it cannot successfully hand<br />
over to the registered instance (e.g. the instance is defunct for whatever<br />
reason and not responding to dbus calls).</p>

<p>Alas, this continues to have some race potential. The problem ultimately<br />
is that we do not know why the service name is already registered and also<br />
cannot ask the service since its not responding to calls. To further<br />
restrict the potential of a race the wait time is increased substantially<br />
when the environment variable KCRASH_AUTO_RESTARTED is set.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R271 KDBusAddons</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D20078">https://phabricator.kde.org/D20078</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/CMakeLists.txt<br />
autotests/deadservicetest.cpp<br />
autotests/kdbussimpleservice.cpp<br />
src/kdbusservice.cpp</div></div></div><br /><div><strong>To: </strong>sitter<br /><strong>Cc: </strong>kde-frameworks-devel, michaelh, ngraham, bruns<br /></div>