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.

With the change, the "GET_UPDATES_IN_PROGRESS" will not be an error
exposed to users any more. Therefore it is removed.

Signed-off-by: Ming Lu <[email protected]>
  • Loading branch information
minglumlu committed May 8, 2024
1 parent 4752acc commit 7d5d08b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
5 changes: 0 additions & 5 deletions ocaml/idl/datamodel_errors.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1913,11 +1913,6 @@ let _ =
~doc:"Failed to get available updates from a host." () ;
error Api_errors.get_updates_failed []
~doc:"Failed to get available updates from the pool." () ;
error Api_errors.get_updates_in_progress []
~doc:
"The operation could not be performed because getting updates is in \
progress."
() ;
error Api_errors.apply_updates_in_progress []
~doc:
"The operation could not be performed because applying updates is in \
Expand Down
2 changes: 0 additions & 2 deletions ocaml/xapi-consts/api_errors.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1261,8 +1261,6 @@ let invalid_repomd_xml = "INVALID_REPOMD_XML"

let get_updates_failed = "GET_UPDATES_FAILED"

let get_updates_in_progress = "GET_UPDATES_IN_PROGRESS"

let apply_updates_in_progress = "APPLY_UPDATES_IN_PROGRESS"

let apply_updates_failed = "APPLY_UPDATES_FAILED"
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_pool_helpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ let blocking_ops =
; (`tls_verification_enable, Api_errors.tls_verification_enable_in_progress)
; (`configure_repositories, Api_errors.configure_repositories_in_progress)
; (`sync_updates, Api_errors.sync_updates_in_progress)
; (`get_updates, Api_errors.get_updates_in_progress)
; (`apply_updates, Api_errors.apply_updates_in_progress)
]

Expand All @@ -52,6 +51,7 @@ let wait_ops =
; `exchange_ca_certificates_on_join
; `copy_primary_host_certs
; `eject
; `get_updates
]

let all_operations = blocking_ops |> List.map fst |> List.append wait_ops
Expand Down

0 comments on commit 7d5d08b

Please sign in to comment.