[Kde-pim] Akonadi Resource - setOnline troubles

Kevin Krammer krammer at kde.org
Wed Feb 19 18:15:49 GMT 2014


On Wednesday, 2014-02-19, 17:31:13, Daniel Vrátil wrote:
> On Tuesday 18 of February 2014 16:41:35 Kevin Krammer wrote:
> > On Tuesday, 2014-02-18, 16:31:43, Daniel Vrátil wrote:
> > > On Monday 17 of February 2014 22:21:09 Martin Koller wrote:

> > > > What about a new method in AgentBase ?, e.g.
> > > > void setTemporaryOffline() { setOnlineInternal(false); }  // not
> > > > storing
> > > > state as desired state
> > > 
> > > Yup, this sounds reasonable. Maybe setTemporaryOffline could even take
> > > an
> > > argument for timeout, set up a timer internally and then emit a signal,
> > > that resource implementations would connect to to check whether we are
> > > online already. Afaik this is pretty much what you've done in the DAV
> > > resource and similar solution would be used in other resources too, so
> > > having this as part of ResourceBase would prevent some code duplication.
> > 
> > I think we have discussed something similar before, i.e. the need to have
> > more states than just online/offline.
> > 
> > The earlier discussion was mostly about distingushing different forms of
> > "offline", i.e. whether the resource or the user is the originator of the
> > state.
> 
> I found the (rather long :) email from Andreas from December 2012.  What I
> understand from the proposal is to have following states:
> 
> TurnedOff
> Akonadi is not allowed to talked to the resource and the resource does
> nothing. But how does the resource get into this state? And when should it
> recover? Is this set by user, server or resource itself?

I can't remember that one but I would assume that the Akonadi Hypervisor 
can/could do that.
But definitely a user choice, only revocable by the user. 

Probably mostly used to "disable" agents that we consider autostart worthy but 
are not needed by the particular user. E.g. new mail notifier if the user does 
not want notifications at all.

> StayDisconnected
> Resource was set offline by user or application.

Do you want to distinguish between direct user control, e.g. through a control 
UI, and applications doing that on behalf of the user, e.g. KMail turning off 
resources on exit?

> Akonadi can talk to it, but
> resource is not allowed to talk to it's storage (IMAP server, maildir...).
> Resource has to be switched to Connected state manually by user or
> application again.
> In this state any attempt to retrieve data from the resource will result in
> ItemRetrievalException on the server, user will be shown a weird error (we
> seriously need Akonadi server to send reasonable error messages we can show
> to users) and KMail will get stuck on "Retrieving email...", because it can
> only tell that ItemFetchJob failed, but does not know why (or has this been
> fixed already?)

From an application's point of view that would be like offline today I guess.
E.g. KMail would show that, allow the user to switch to "on" again.
Does Akonadi server even try to retrieve items from an "offline" resource?

> Disconnected
> Resource requires access to network, but no network is available.
> ResourceBase automatically moves between Disconnected and Connected states
> based on network availability reported by Solid. There is the same problem
> with data retrieval as in StayDisconnected.

Right, that basically is the current "offline" for network resources.

> TemporaryDisconnected ( == BackendNotAvailable? )
> Network is available,  but connection to server cannot be established (or
> maildir folder is not available because it's not mounted for instance).

I would consider an unmounted device to be more Disconnected.
Like "there is no chance in hell I can access the data".

For file system based resources TemporarilyDisconnected would be more 
something like "Disk full".

> Resource sets itself to this state and will attempt to reach the backend
> periodically (ResourceBase will emit a "tryReconnect" signal in configurable
> intervals). Once it succeeds, it will switch itself back to Connected.
> 
> Connected
> Everything is fine.
> 
> 
> Is this +- what you and Andreas had in mind?

Yes, mostly :)

s/resource/agent/ in most cases though [1]

> > Maybe this is just another good reason to get this rolling? :)
> 
> Right, I doubt I'll get to do it anytime soon, so if Martin is willing do
> dig deeper into kdepimlibs, why not :-)

:-)

Cheers,
Kevin

[1] e.g. Feeder agent:
Nepomuk/Baloo not installed or disabled by user -> Disconnected
N/B installed/enabled but not running -> TemporarilyDisconnected
PIM Indexing disabled -> TurnedOff
PIM Indexing paused by user -> StayDisconnected

Not necessarily an everyday user would do but nice for monitoring/control UIs 
or policy based control (e.g. via Activities).
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20140219/17d155f8/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list