Merge lp:~charlesk/keeper/service-dbusmock-should-notice-helper-failure into lp:keeper
Status: | Merged |
---|---|
Merge reported by: | Charles Kerr |
Merged at revision: | 57 |
Proposed branch: | lp:~charlesk/keeper/service-dbusmock-should-notice-helper-failure |
Merge into: | lp:keeper |
Diff against target: |
563 lines (+212/-146) 4 files modified
tests/com_canonical_keeper.py (+166/-121) tests/dbusmock/keeper-template-test.cpp (+1/-1) tests/unit/tar/keeper-tar-create-test.cpp (+1/-1) tests/utils/keeper-dbusmock-fixture.h (+44/-23) |
To merge this branch: | bzr merge lp:~charlesk/keeper/service-dbusmock-should-notice-helper-failure |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Xavi Garcia (community) | Approve | ||
Review via email: mp+301711@code.launchpad.net |
Commit message
The keeper dbusmock now sets a task's status to 'failure' if its helper fails.
Description of the change
The keeper dbusmock now sets a task's status to 'failure' if its helper fails.
This required some medium-sized changes in how the mock keeps state, but the idea is straightforward:
* Previously the work struct only held backup blob pieces and it was created when helper asked for a socket.
* The work struct's role is expanded to monitor the helper process for error. It now also holds the helper's pid, the action state, and so on (and is renamed TaskData to reflect this bigger role). It's now created for each task when StartBackup() or StartRestore() called, and is used to build state when com.canonical.
In order for the client apps to query the tasks even after the tasks all finish, eg to show what succeeded and what failed, we keep TaskData round even after the tasks finish. They're cleared out only when the next call to StartBackup() / StartRestore() is made.
NB: Keeping task data around is something we'll need to do in production's BackupManager as well.
This patch also updates keeper-
Looks good to me, thanks!