Why org.freedesktop.DBus.Local.Disconnected is called?

Sheng Mao shngmao at gmail.com
Thu Nov 12 05:09:05 UTC 2020


Hi Thiago,

Thank you for the suggestion!

I should have come back and update my findings. In my case, dbus disconnection
is caused by 99-restart-dbus.sh <https://src.fedoraproject.org/rpms/kde-settings/blob/34266bc9b362b3db9f0ef5c7e4a3d0154a02f8a9/f/99-restart-dbus.sh> in Fedora 33 plasma-workspace, which is added recently.
This script is triggered by plasma-shutdown and it restarts dbus-broker after 8 seconds.

But for kwin_x11 itself, it never exits, as XCB_SELECTION_CLEAR is never triggered.
I am working on merge request !438 <https://invent.kde.org/plasma/kwin/-/merge_requests/438> to find a better solution to terminate kwin_x11
before dbus gets restarted (or never restarted).


Thank you for your help!

> On Nov 11, 2020, at 21:32, Thiago Macieira <thiago at kde.org> wrote:
> 
> On Sunday, 8 November 2020 08:16:37 PST Sheng Mao wrote:
>> Thank you for explaining this, Thiago!
>> 
>> Then it means the unregistration code kwin_x11 will not be executed.
>> Although I still don’t know who/why terminates the session but it is
>> something I can use.
> 
> You can debug to find out the order in which events are happening. Does 
> kwin_x11 exit before the dbus-daemon exits? Or does the daemon exit first, 
> thus causing kwin_x11 to quit?
> 
> And is there sufficient time for dbus-daemon to notice other applications' 
> exit and send service name deregistration signals? If all the processes are 
> terminated too quickly, dbus-daemon may react to its termination before 
> handling all the sockets.
> 
>> * in kwin_x11, I need to add a watcher for session disconnected, and close
>> kwin_x11 event loop on that
>> * in startkde, I need to add a timer to query registration status. My test
>> app shows that the service becomes unregistered after a few seconds.
>> QDBusServiceWatcher cannot send a unregistration event/signal if
>> org.kde.KWin is terminated passively.
>> 
>> Thank you! I will do more tests on that.
> 
> You should simply react to the Disconnected signal and handle that as a 
> deregistration of every single service name.
> 
> Note you can't send anything to D-Bus any more.
> 
> -- 
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>   Software Architect - Intel DPG Cloud Engineering
> 
> 
> 
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dbus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20201111/e4af90bf/attachment.htm>


More information about the dbus mailing list