Bug 379997 - Always "Akonadi not started" overlay on reboot
Summary: Always "Akonadi not started" overlay on reboot
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 5.4.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-19 07:27 UTC by Gerd Fleischer
Modified: 2017-12-09 20:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerd Fleischer 2017-05-19 07:27:19 UTC
I run kmail in the system tray. I shut down without closing kmail, then on reboot I always get the overlay "Akonadi server not running" despite it is.

Does not happen if closed explicitly.

Happens on 2 systems with clean install.
Comment 1 David Faure 2017-12-08 23:04:08 UTC
Pending fix: https://phabricator.kde.org/D9264
Comment 2 David Faure 2017-12-09 20:58:27 UTC
Git commit f8d59a48e68fc89949bd16cf97097f207f609324 by David Faure.
Committed on 09/12/2017 at 20:58.
Pushed by dfaure into branch 'master'.

ErrorOverlay: don't show by mistake if called with Running twice.

Summary:
If serverStateChanged(Running) is called twice, the first time
this would hide the overlay and set mOverlayActive=false,
so the second time this goes into the else branch, which
shows the overlay...

The reason it's called twice isn't because ServerManager
emits stateChanged(Running) twice, obviously (it only emits on actual
change). The reason is that the ErrorOverlay constructor calls
serverStateChanged(state) and connects to &ServerManager::stateChanged.
It can happen that for this initial state, ServerManager::state() finds
out "Running" before ServerManager gets a chance to notice by itself
and emit stateChanged().

Test Plan:
Found with debug output, during session startup,
over many weeks (it's clearly a race condition).

Reviewers: dvratil, vkrause

Reviewed By: dvratil

Subscribers: #kde_pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D9264

M  +7    -5    src/widgets/erroroverlay.cpp

https://commits.kde.org/akonadi/f8d59a48e68fc89949bd16cf97097f207f609324
Comment 3 David Faure 2017-12-09 20:59:14 UTC
Git commit 10db44a34c4fa0d0907bdc1abfec674fed920dcf by David Faure.
Committed on 09/12/2017 at 20:58.
Pushed by dfaure into branch 'Applications/17.12'.

ErrorOverlay: don't show by mistake if called with Running twice.

Summary:
If serverStateChanged(Running) is called twice, the first time
this would hide the overlay and set mOverlayActive=false,
so the second time this goes into the else branch, which
shows the overlay...

The reason it's called twice isn't because ServerManager
emits stateChanged(Running) twice, obviously (it only emits on actual
change). The reason is that the ErrorOverlay constructor calls
serverStateChanged(state) and connects to &ServerManager::stateChanged.
It can happen that for this initial state, ServerManager::state() finds
out "Running" before ServerManager gets a chance to notice by itself
and emit stateChanged().

Test Plan:
Found with debug output, during session startup,
over many weeks (it's clearly a race condition).

Reviewers: dvratil, vkrause

Reviewed By: dvratil

Subscribers: #kde_pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D9264

(cherry picked from commit f8d59a48e68fc89949bd16cf97097f207f609324)

M  +7    -5    src/widgets/erroroverlay.cpp

https://commits.kde.org/akonadi/10db44a34c4fa0d0907bdc1abfec674fed920dcf