Version: 1.4.0 (using KDE 4.5.0) OS: Linux When running 'akonadictl stop', it takes around 30 seconds to shutdown Akonadi. Furthermore, there's always a 'mysqld' process like this left: 3966 ? Sl 3:38 /usr/sbin/mysqld --defaults-file=/home/elias/.local/share/akonadi//mysql.conf --datadir /home/elias/.local/share/akonadi/db_data/ --socket=/home/elias/.local/share/akonadi/db_misc/mysql.socket The strange thing about this is: this process can be easily terminated by sending a SIGTERM (kill $PID). Reproducible: Always Steps to Reproduce: - Remove all Akonadi related configuration from your homedir - Create a new Akonadi configuration from scratch - Add some resources (2 IMAP, 1 CalDAV, 1 VCF-File) - Shutdown Akonadi Actual Results: It takes very long to shutdown Akonadi. There is nearly no disk activity (HDD LED + iotop) during the shutdown. Not all mysqld processes are terminated. Expected Results: The shutdown takes only some seconds. All mysqld processes are terminated correctly.
Created attachment 50707 [details] Output of 'akonadictl stop' When running 'akonadictl start' and 'akonadictl stop' afterwards on a terminal, a lot of output is created when running 'akonadictl stop'. The whole shutdown process ends with a backtrace due to a crash. There are messages like: ProcessControl: Application '/usr/bin/akonadi_imap_resource' stopped unexpected (Process crashed) Application '/usr/bin/akonadi_imap_resource' crashed. No restart! or: [akonadiserver] "Cannot connect to agent instance with identifier 'akonadi_imap_resource_1', error message: 'Could not get owner of name 'org.freedesktop.Akonadi.Resource.akonadi_imap_resource_1': no such name'" [akonadiserver] processing retrieval request for item 50092 parts: ("RFC822") of resource: "akonadi_imap_resource_1" The full output is attached.
Changed to 'crash' as the previously attached output looks like, Akonadi is crashing on shutdown.
Paste a backtrace ( and try new version of akonadi/kdepim )
Reopened, and removed "CRASH". The crash part is fixed now. The slowdown is not fixed.
I consider this to be fixed now (KDEPIM 4.7.1). Shutting down Akonadi even when it is just synching a newly added IMAP account takes around 20 seconds. The only strange thing: during shutdown, it seems that some of the agents crash, as they appear as '<defunct>' in the process listing: elias@moria ~ % ps aux | grep akon elias 5714 0.0 0.0 138868 5356 ? Sl 08:11 0:00 /usr/bin/akonadi_control elias 5718 0.6 0.1 325220 9948 ? Sl 08:11 0:01 akonadiserver elias 5720 0.9 0.7 357324 42672 ? Sl 08:11 0:02 /usr/sbin/mysqld --defaults-file=/home/elias/.local/share/akonadi//mysql.conf --datadir=/home/elias/.local/share/akonadi/db_data/ --socket=/home/elias/.local/share/akonadi/socket-moria/mysql.socket elias 5753 0.1 0.0 0 0 ? Z 08:11 0:00 [akonadi_gcal_re] <defunct> elias 5754 0.1 0.0 0 0 ? Z 08:11 0:00 [akonadi_googled] <defunct> elias 5760 0.0 0.0 0 0 ? Z 08:11 0:00 [akonadi_nepomuk] <defunct> elias 5766 0.0 0.0 0 0 ? Z 08:11 0:00 [akonadi_agent_l] <defunct> elias 5844 1.2 0.6 474944 39176 ? Sl 08:12 0:03 /usr/bin/akonadi_imap_resource --identifier akonadi_imap_resource_3
(In reply to comment #5) > The only strange thing: during shutdown, it seems that some of the agents > crash, as they appear as '<defunct>' in the process listing: There are also messages indicating a crash in the akonadiserver output: void Akonadi::NotificationSource::unsubscribe() "akonadi_davgroupware_resource_0" ProcessControl: Application '/usr/bin/akonadi_agent_launcher' stopped unexpected (Process crashed) Application '/usr/bin/akonadi_agent_launcher' crashed. No restart! Lost connection to resource "org.freedesktop.Akonadi.Resource.akonadi_maildir_resource_0" , discarding cached interface void Akonadi::NotificationSource::serviceUnregistered(const QString&) Notification source "AkonadiAgentServer" now serving: () void Akonadi::NotificationSource::unsubscribe() "AkonadiAgentServer" Lost connection to resource "org.freedesktop.Akonadi.Resource.akonadi_googledata_resource_0" , discarding cached interface void Akonadi::NotificationSource::serviceUnregistered(const QString&) Notification source "akonadi_googledata_resource_0" now serving: () What's the easiest way to get a backtrace of these processes?
One day we'll fix this report title (there's only one mysqld process), anyway: (In reply to comment #5) > I consider this to be fixed now (KDEPIM 4.7.1). > Shutting down Akonadi even when it is just synching a newly added IMAP account > takes around 20 seconds. I cannot agree. That highly depends on the resources activity when akonadictl stop is executed. Reproducing is easy: run "check mail" with several imap accounts configured and run akonadictl stop and look at the akonadiserver activity: With a few imap resources : [cut] akonadi_imap_resource_6(28179)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig: akonadi_imap_resource_6(28179)/libakonadi Akonadi::CollectionSync::Private::execute: void Akonadi::CollectionSync::Private::execute() localListDone: false deliveryDone: true (repeated for each imap resource) QProcess: Destroyed while process is still running. Lost connection to resource "org.freedesktop.Akonadi.Resource.akonadi_imap_resource_7" , discarding cached interface void Akonadi::NotificationSource::serviceUnregistered(const QString&) Notification source "akonadi_imap_resource_7" now serving: () void Akonadi::NotificationSource::unsubscribe() "akonadi_imap_resource_7" ProcessControl: Application '/kde/inst/kdepim-runtime/bin/akonadi_imap_resource' stopped unexpectedly (Process crashed) Application '/kde/inst/kdepim-runtime/bin/akonadi_imap_resource' crashed. No restart! Application '/kde/inst/kdepim-runtime/bin/akonadi_imap_resource' exited normally... Application '/kde/inst/akonadi/bin/akonadi_agent_launcher' exited normally... Application '/kde/inst/akonadi/bin/akonadi_agent_launcher' exited normally... Application '/kde/inst/akonadi/bin/akonadi_agent_launcher' exited normally... Application '/kde/inst/akonadi/bin/akonadi_agent_launcher' exited normally... Application '/kde/inst/akonadi/bin/akonadi_agent_launcher' exited normally... Application '/kde/inst/kdepim-runtime/bin/akonadi_nepomuk_calendar_feeder' exited normally... Application '/kde/inst/kdepim/bin/akonadi_nepomuk_email_feeder' exited normally... Application '/kde/inst/kdepim-runtime/bin/akonadi_davgroupware_resource' exited normally... Application '/kde/inst/kdepim-runtime/bin/akonadi_nepomuk_contact_feeder' exited normally... Application '/kde/inst/kdepim-runtime/bin/akonadi_maildispatcher_agent' exited normally... but the mail check goes on.. [cut] akonadi_imap_resource_2(28175)/kdepimlibs (kimap) RetrieveCollectionMetadataTask::doStart: Not refreshing because of timestamp akonadi_imap_resource_2(28175)/kdepimlibs (kimap) RetrieveCollectionMetadataTask::doStart: "/INBOX" akonadi_imap_resource_2(28175)/kdepimlibs (kimap) RetrieveCollectionMetadataTask::doStart: Not refreshing because of timestamp akonadi_imap_resource_2(28175)/kdepimlibs (kimap) RetrieveCollectionMetadataTask::doStart: "/Drafts" akonadi_imap_resource_2(28175)/kdepimlibs (kimap) RetrieveCollectionMetadataTask::doStart: Not refreshing because of timestamp akonadi_imap_resource_2(28175)/kdepimlibs (kimap) RetrieveCollectionMetadataTask::doStart: "/kde-commits" [cut] and at some point, the Akonadi server is fed up and starts killing the processes that didn't stop in a reasonable time QProcess: Destroyed while process is still running. Lost connection to resource "org.freedesktop.Akonadi.Resource.akonadi_imap_resource_0" , discarding cached interface void Akonadi::NotificationSource::serviceUnregistered(const QString&) Notification source "akonadi_imap_resource_0" now serving: () void Akonadi::NotificationSource::unsubscribe() "akonadi_imap_resource_0" ProcessControl: Application '/kde/inst/kdepim-runtime/bin/akonadi_imap_resource' stopped unexpectedly (Process crashed) Application '/kde/inst/kdepim-runtime/bin/akonadi_imap_resource' crashed. No restart! etc..
*** Bug 302193 has been marked as a duplicate of this bug. ***
Except the mysqld process (this is with Akonadi 1.13 master git branch with database optimizations and KDEPIM + Runtime 4.14.2 as packages in Debian unstable): ms@merkaba:~> akonadictl stop Akonadi is not running. ms@merkaba:~#4> akonadictl status Akonadi Control: stopped Akonadi Server: stopped search paths: ("/usr/local/lib/kde4", "/home/ms/.kde/lib/kde4/plugins/", "/usr/lib/kde4/plugins/", "/usr/local/lib/plugins/", "/usr/lib/x86_64-linux-gnu/qt4/plugins", "/usr/local/bin", "/usr/lib/kde4/plugins", "/usr/local/lib/plugins", "/home/ms/.kde/lib/kde4/", "/usr/lib/kde4/") Akonadi Server Search Support: available (Remote Search, Akonadi Baloo Search Plugin) Available Agent Types: akonadi_akonotes_resource, akonadi_archivemail_agent, akonadi_baloo_indexer, akonadi_birthdays_resource, akonadi_contacts_resource, akonadi_davgroupware_resource, akonadi_folderarchive_agent, akonadi_followupreminder_agent, akonadi_googlecalendar_resource, akonadi_googlecontacts_resource, akonadi_ical_resource, akonadi_icaldir_resource, akonadi_imap_resource, akonadi_invitations_agent, akonadi_kabc_resource, akonadi_kalarm_dir_resource, akonadi_kalarm_resource, akonadi_kcal_resource, akonadi_kdeaccounts_resource, akonadi_knut_resource, akonadi_kolab_resource, akonadi_kolabproxy_resource, akonadi_localbookmarks_resource, akonadi_maildir_resource, akonadi_maildispatcher_agent, akonadi_mailfilter_agent, akonadi_mailtransport_dummy_resource, akonadi_mbox_resource, akonadi_migration_agent, akonadi_mixedmaildir_resource, akonadi_nepomuk_feeder, akonadi_newmailnotifier_agent, akonadi_nntp_resource, akonadi_notes_agent, akonadi_notes_resource, akonadi_openxchange_resource, akonadi_pop3_resource, akonadi_sendlater_agent, akonadi_vcard_resource, akonadi_vcarddir_resource ms@merkaba:~> ps aux | grep "[m]ysql" | grep ms ms 4006 0.4 3.8 2809592 631456 ? Sl Jan27 6:26 /usr/sbin/mysqld --defaults-file=/home/ms/.local/share/akonadi/mysql.conf --datadir=/home/ms/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-ms.QEKpW0/mysql.socket After minutes after issuing akonadictl stop: ms@merkaba:~> ps aux | grep "[m]ysql" | grep ms ms 4006 0.4 3.8 2809592 631456 ? Sl Jan27 6:27 /usr/sbin/mysqld --defaults-file=/home/ms/.local/share/akonadi/mysql.conf --datadir=/home/ms/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-ms.QEKpW0/mysql.socket And look when I start it again: ms@merkaba:~> ps aux | grep "[m]ysql" | grep ms ms 4006 0.4 3.8 2809592 632112 ? Sl Jan27 6:40 /usr/sbin/mysqld --defaults-file=/home/ms/.local/share/akonadi/mysql.conf --datadir=/home/ms/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-ms.QEKpW0/mysql.socket ms 29368 1.0 0.5 787196 85964 ? Sl 09:54 0:00 /usr/sbin/mysqld --defaults-file=/home/ms/.local/share/akonadi/mysql.conf --datadir=/home/ms/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-ms.QEKpW0/mysql.socket This is a *huge*, *big* *no-go*. At no point of time Akonadi should there *ever* be *two* instances of MySQL running for the same user and the *same* database. As this bug is about the stopping of Akonadi I will file a new bug about having two instances of MySQL running. From all I know this just is a very, very bad idea.
Ah, I reported this already: Bug 340813 - sometimes two copies of mysqld are running with Akonadi (edit) adding to it.
This bug has never been confirmed for a KDE PIM version that is based on KDE Frameworks (5.x). Those versions differ significantly from the old 4.x series. Therefore, I plan to close it in around two or three months. In the meantime, it is set to WAITINGFORINFO to give reporters the oportunity to check if it is still valid. As soon as someone confirms it for a recent version (at least 5.1, ideally even more recent), I'll gladly reopen it. Please understand that we lack the manpower to triage bugs reported for versions almost two years beyond their end of life.
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.1 aka 15.12; preferably much more recent), please open a new one unless it already exists. Thank you for all your input.