Merge lp:~seif/zeitgeist/catch_cache_error into lp:zeitgeist/0.1
Proposed by
Seif Lotfy
Status: | Merged |
---|---|
Merge reported by: | Seif Lotfy |
Merged at revision: | not available |
Proposed branch: | lp:~seif/zeitgeist/catch_cache_error |
Merge into: | lp:zeitgeist/0.1 |
Diff against target: |
63 lines (+30/-9) 1 file modified
_zeitgeist/engine/main.py (+30/-9) |
To merge this branch: | bzr merge lp:~seif/zeitgeist/catch_cache_error |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Markus Korn | Approve | ||
Review via email: mp+46056@code.launchpad.net |
Description of the change
So I just added a little temporary fix that I would like to see with the next release.
Instead of zeitgeist returning nothing when requesting a time-period with a broken event, zeitgeist now can ignore the broken event and return a list with healthy events. The broken events can be seen in the log under Error
To post a comment you must log in.
I like the general idea of this workaround: hiding the KeyError to the clients, and log an error server-side instead.
However your solution gives me a bad feeling: It ignores our own policy that all events must have at least one subject. So in your workaround it is possible to get events with no subject back. Also, as we don't know what's going wrong I think it makes no sense to limit this workaround to subjects, are we really sure that this kind of broken db entries can not happen to Event interpretations for example too?
My suggestion is: in case of *any* error in the process of creating Event and Subject objects from a db row let's just block the whole event from being returned, let's return None. And log an error server-side, of course.