Skip to content

Commit 2d9ce45

Browse files
committed
CA-389319: Wait and retry for GET_UPDATES_IN_PROGRESS
The query on HTTP endpoint /updates will return the available updates in JSON format. Prior to the changes in this commit, if a query arrives when another query is being handled, a "GET_UPDATES_IN_PROGRESS" error will be returned immediately. This behaviour is not friendly to GUI client XenCenter. In this commit, the behaviour is changed to wait and retry in handling the query in xapi since the "*_IN_PROGGRESS" error is a transient failure. Tolerating it in xapi (server) side avoids error handling in client side. Signed-off-by: Ming Lu <ming.lu@cloud.com>
1 parent 4752acc commit 2d9ce45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ocaml/xapi/helpers.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1654,8 +1654,9 @@ let retry ~__context ~doc ?(policy = Policy.standard) f =
16541654
) ;
16551655
f ()
16561656
with
1657-
| Api_errors.Server_error (code, _ :: _) as e
1657+
| Api_errors.Server_error (code, _) as e
16581658
when code = Api_errors.other_operation_in_progress
1659+
|| code = Api_errors.get_updates_in_progress
16591660
->
16601661
debug "%s locking failed: caught transient failure %s" doc
16611662
(ExnHelper.string_of_exn e) ;

0 commit comments

Comments
 (0)