← Back to team overview

ubuntu-accomplishments-contributors team mailing list archive

Maintaining State

 

Hi Folks,

(this is probably going to primarily of interest to Rafal but I wanted
to copy in the list for completeness)

This evening I was working on fixing
https://bugs.launchpad.net/ubuntu-accomplishments-daemon/+bug/982797
and the bug points a deeper problem that we have in how we maintain
state.

There are two challenges here:

  1. When we perform a script run we track a few bits of ste:
    - The total number of scripts to run.
    - The results from the current run.
    - We also track the dependency chain.

     These variables are used for example to check when we have
unlocked opportunities. The problem here is that we react to
accomplished trophies when they arrive and we check these state
variables, but the state may have changed and there may be another
script run going on while we are performing this check. This is
causing some race condition issues. We will need to resolve this for
the 0.1 release.

  2. We are also starting to grow quite a collection of different
variables that are tracking things in the daemon (e.g. whether the
script is running, the uid, the various script variables etc. It may
be cleaner and have a standard "state-store" which could be a
dictionary that we use to maintain all of this more easily. This will
stop us having to remember what all of these variable do.

In terms of (1), I am not entirely sure what the best solution is. One
simple solution is that we remove the functionality to auto-trigger a
script run when something has been unlocked, but it would be useful if
we could solve this and provide a means to trigger a script run
whenever. My hunch here is that we need to disconnect the state from
the script run. Any thoughts on the best approach?

   Jono

-- 
Jono Bacon
Ubuntu Community Manager
www.ubuntu.com / www.jonobacon.org
www.identi.ca/jonobacon www.twitter.com/jonobacon


Follow ups