Bug 97716 - kded doesn't shutdown properly
Summary: kded doesn't shutdown properly
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kded
Classification: Unclassified
Component: general (show other bugs)
Version: 5.90.0
Platform: unspecified Linux
: NOR grave
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 448180 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-23 14:14 UTC by Volker Krause
Modified: 2022-05-23 18:38 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.25


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Krause 2005-01-23 14:14:39 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

Steps to reproduce:
- change something in a wallet (eg. add a folder/key, change/delete existing key)
- keep the wallet open (works when wallet is closed)
- logout
- login again -> all changes are gone

This happens in CVS HEAD and 3.3.2 and seems to cause #97324, #95615 (comment #12-#14) and #97699.
Comment 1 George Staikos 2005-01-23 20:50:41 UTC
On Sunday 23 January 2005 08:14, Volker Krause wrote:
> Steps to reproduce:
> - change something in a wallet (eg. add a folder/key, change/delete
> existing key) - keep the wallet open (works when wallet is closed)
> - logout
> - login again -> all changes are gone
>
> This happens in CVS HEAD and 3.3.2 and seems to cause #97324, #95615
> (comment #12-#14) and #97699.

   Sounds like kded isn't shutting down cleanly.  Nothing in this kwallet code 
has changed.

Comment 2 Joff Lee 2005-02-11 16:48:08 UTC
I'm getting the same problems, but with kmail's passwords.
Launch kmail - get asked for passwords, I put them in, then check kwalletmanager, and the passwords are there. logout then log back in, and the passwords are no-longer in kwalletmanager (and kmail asks me for them again...)

on beta2 gentoo split ebuilds
Comment 3 Joff Lee 2005-02-11 17:08:18 UTC
aha..!
I've just played around with the options in kdewallemanager ( settings >configure wallet manager)

under "Close wallet", i checked "Close when last application stops using it"
(the only option checked there)

and it works now :)

*happy*
Comment 4 Volker Krause 2005-02-18 13:12:31 UTC
It indeed seems to be a problem of kded. When killing kded manually, everything works as expected (KWalletD destructor is called which saves the changes). When kded is terminated during logout, the kded destructor is called but not completely executed.
Adding something like:
  kdDebug(7020) << "bla" << endl;
  sleep (1);
  kdDebug(7020) << "blub" << endl;
to ~Kded() shows only 'bla'. This happens as soon as there is an operations that takes some time (e.g. saving wallet changes).
Comment 5 George Staikos 2005-02-18 18:05:04 UTC
On Friday 18 February 2005 07:12, Volker Krause wrote:
> 13:12 ------- It indeed seems to be a problem of kded. When killing kded
> manually, everything works as expected (KWalletD destructor is called which
> saves the changes). When kded is terminated during logout, the kded
> destructor is called but not completely executed. Adding something like:
>   kdDebug(7020) << "bla" << endl;
>   sleep (1);
>   kdDebug(7020) << "blub" << endl;
> to ~Kded() shows only 'bla'. This happens as soon as there is an operations
> that takes some time (e.g. saving wallet changes).

  I could put a timer in to save on intervals, but it's unexpected and could 
be heavy on cpu / cause latency for kded.

Comment 6 Waldo Bastian 2005-02-18 18:52:06 UTC
kded should somehow get the time to shutdown properly.
Comment 7 Waldo Bastian 2005-02-22 00:52:21 UTC
CVS commit by waba: 

* Restrict DCOP socket to own user only (umask)
* Delay shutting down till all clients have gone.
BUG: 97716


  M +35 -4     dcopserver.cpp   1.173
  M +4 -1      dcopserver.h   1.38
  M +15 -3     dcopserver_shutdown.c   1.12
  M +1 -4      KDE-ICE/Xtranssock.c   1.11



Comment 8 popov895 2022-01-11 08:21:02 UTC
When logging out, kded5 either doesn't delete loaded modules at all (which happens most often) or only deletes a few of all loaded ones. When kded5 is killed manually, it only deletes all modules if it receives a SIGHUP signal.

I can only confirm this issue on KDE neon (both User and Development Edition) and openSUSE Tumbleweed.

See https://bugs.kde.org/show_bug.cgi?id=445376#c9.

SOFTWARE/OS VERSIONS

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.23.80
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-44-generic (64-bit)
Graphics Platform: X11
Comment 9 popov895 2022-01-11 08:21:33 UTC
*** Bug 448180 has been marked as a duplicate of this bug. ***
Comment 10 popov895 2022-01-11 19:52:03 UTC
Looks like ksmserver kills kded5 before it completely exits.
Comment 11 Bug Janitor Service 2022-01-15 10:12:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1364
Comment 12 David Edmundson 2022-05-18 06:56:20 UTC
Git commit 127cd6313348968e5092cfd37cf4ffa47c14ed17 by David Edmundson, on behalf of Eugene Popov.
Committed on 18/05/2022 at 06:56.
Pushed by davidedmundson into branch 'master'.

[startplasma] Do not call QProcess::close() before QProcess::terminate()

Calling QProcess::close() before QProcess::terminate() will cause the process to be killed before we try to terminate it.

M  +1    -4    startkde/startplasma.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/127cd6313348968e5092cfd37cf4ffa47c14ed17