Bug 328421 - Refactor session related codepaths to use jobs
Summary: Refactor session related codepaths to use jobs
Status: RESOLVED UNMAINTAINED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: IMAP resource (show other bugs)
Version: GIT (master)
Platform: unspecified Linux
: LO normal
Target Milestone: ---
Assignee: Christian Mollekopf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-04 11:29 UTC by Christian Mollekopf
Modified: 2017-01-07 22:45 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 Christian Mollekopf 2013-12-04 11:29:55 UTC
The codepaths related to the session setup are currently very error prone, since they use a lot of async code, but don't protect the internal state of the objects sufficiently. This can be solved by moving all async code and the related state to dedicated job objects.

In particular are synchronous dialogs invoked, meaning almost arbitrary callbacks can occur if the user forgets a dialog and then closes it, at which point the object may already be in a completely different state.

Some examples are:
* SessionPrivate::handleSslError invokes a dialog at the end of a process started by SessionPrivate::startSsl, while the process depends on the internal state of SessionThread and startSsl may be invoked multiple times. This means SessoinThread::sslErrorHandlerResponse can be invoked at any time, even if a second run of startSsl already succeeded and already established a secure connection.

* SessionPool::onPasswordRequestDone can be invoked again due to a stale password dialog getting completed. At this stage assumptions about the internal state (such as m_pendingInitialSession being set in the ReconnectNeeded) are likely to not be true anymore.

The bottom line is, either protect async codepaths from being entered multiple times, or move the state to separate job objects, so the code can safely be run multiple times in parallel.

I'm pretty sure this would fix at least some of the crashes we have in the imap resource.

Reproducible: Always
Comment 1 Denis Kurz 2016-09-24 20:40:43 UTC
This bug has only been reported for versions older than KDEPIM 4.14 (at most akonadi-1.3). Can anyone tell if this bug still present?

If noone confirms this bug for a recent version of akonadi (part of KDE Applications 15.08 or later), it gets closed in about three months.
Comment 2 Denis Kurz 2017-01-07 22:45:13 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.