[Engine-patches] Change in ovirt-engine[master]: restapi: Poll Job-Id on Restore-Snapshot
oliel at redhat.com
oliel at redhat.com
Wed May 9 05:30:32 EDT 2012
Ori Liel has submitted this change and it was merged.
Change subject: restapi: Poll Job-Id on Restore-Snapshot
......................................................................
restapi: Poll Job-Id on Restore-Snapshot
Restoring a snapshot involves two Backend calls. The second call
should only be issues after the first action is over, meaning the
first action should run in 'blocking' mode.
Until now blocking mode has been implemented by polling the status
of the VDSM tasks. But this leaves room for a race condition, in
cases where the VDSM tasks have completed, but Backend itself is
still busy executing logic (and thus is not available yet for the
second call).
This patch adds the ability for actions to poll on the job-id. The
'Job' is a new Backend concept. A job is an umbrella for all VDSM
tasks that are run as a result of a Backend call, plus the Backend
logic itself. Polling the job status is always safer, and should in
the future replace all polling of VDSM tasks status. This patch
provides this ability for actions. At this point polling the job or
the VDSM tasks is still presented as a choice to the programmer.
Change-Id: I4bdff56b7a2c6ee95c52a4134a19bc1e05a34b19
Signed-off-by: Ori Liel <ori.liel at gmail.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcReturnValueBase.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendActionableResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendApiResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSnapshotResource.java
7 files changed, 92 insertions(+), 27 deletions(-)
Approvals:
Ori Liel: Verified; Looks good to me, approved
--
To view, visit http://gerrit.ovirt.org/4117
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4bdff56b7a2c6ee95c52a4134a19bc1e05a34b19
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ori Liel <oliel at redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpastern at redhat.com>
Gerrit-Reviewer: Ori Liel <oliel at redhat.com>
More information about the Engine-patches
mailing list