Skip to content

Commit

Permalink
CA-389319: Wait and retry for GET_UPDATES_IN_PROGRESS
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
minglumlu committed May 7, 2024
1 parent 4752acc commit 2d9ce45
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ocaml/xapi/helpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1654,8 +1654,9 @@ let retry ~__context ~doc ?(policy = Policy.standard) f =
) ;
f ()
with
| Api_errors.Server_error (code, _ :: _) as e
| Api_errors.Server_error (code, _) as e
when code = Api_errors.other_operation_in_progress
|| code = Api_errors.get_updates_in_progress
->
debug "%s locking failed: caught transient failure %s" doc
(ExnHelper.string_of_exn e) ;
Expand Down

0 comments on commit 2d9ce45

Please sign in to comment.