Lost settings on abnormal shutdown

Mark Kretschmann kretschmann at kde.org
Sat Oct 17 10:23:24 UTC 2009


On Sat, Oct 17, 2009 at 11:40 AM, Michael Liddle <michael at liddle.net.nz> wrote:
> Mark Kretschmann wrote:
>> However, some things are not stored immediately, partly for
>> performance reasons, and partly because we forgot (detailed hints
>> welcome).
>
> Major one's I've noticed:
>
> - Changes to widgets (added/removed/moved)
> - Changes to the main window layout (i.e. the new dockable panels in 2.2)

Ok, that's interesting. As these are rather new features, we probably
forgot to sync to HDD. I assume we'll be able to fix this.

>> One example of data that is not stored immediately is the
>> current playlist. Some users have giant playlists (like 10,000
>> tracks), which I find a bit crazy, but that's how things are. Storing
>> this after each modification is quite slow, performance wise. It could
>> be done, but it's complicated. I have some ideas for implementing this
>> in the future.
>
> Hmmm... well the rationale here seems fairly sound: incremental saving
> of these settings shouldn't be particularly noticable to the user.
> Although, I'm with you on the massive playlist being a bit crazy (though
> I do listen to much music on a fairly "traditional" album-by-album
> basis). Thinking of myself mostly (I rarely have more than 200 tracks in
> the playlist), would it be possible to save the playlist immediately if
> it's less than a certain size?

Well, no, that would be a kludge I think. I would prefer to solve it
properly. My idea is using multi-threading for saving the playlist,
and also storing it in the database, which may be faster than storing
as XSPF.

>> I should also mention that with traditional application design such
>> data is always stored on shutdown. Only lately it has become a trend
>> to store this data immediately, as it makes things crash persistent.
>> Generally I think this is a good trend.
>
> While crash resistance would definitely be cool, the major one for me is
>  when I log out. If I didn't explicitly quit amarok from the systray,
> all of the above are lost. I don't know how it works (TERM signal?), but
> it'd be great if its possible to handle this like a "normal" shutdown.

That's definitely not normal. When you log out from your desktop
(let's say KDE), the desktop sends all applications the TERM signal,
then waits a few seconds, then sends KILL to apps that haven't shut
down yet. TERM does the same as a normal shutdown (Quit). So, what
happens here is either your Amarok takes too long to shut down, or
your desktop does something incorrectly.

As for Amarok, start it with "amarok --debug --nofork" from the
terminal once. It will print tons of information. Click "Quit" in
Amarok, and then check if you can see anything weird in the debug
output (it provides timing information too).

-- 
Mark Kretschmann
Amarok Developer
www.kde.org - amarok.kde.org



More information about the Amarok mailing list