Skip to content

Commit 7d5d08b

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. 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 <ming.lu@cloud.com>
1 parent 4752acc commit 7d5d08b

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

ocaml/idl/datamodel_errors.ml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,11 +1913,6 @@ let _ =
19131913
~doc:"Failed to get available updates from a host." () ;
19141914
error Api_errors.get_updates_failed []
19151915
~doc:"Failed to get available updates from the pool." () ;
1916-
error Api_errors.get_updates_in_progress []
1917-
~doc:
1918-
"The operation could not be performed because getting updates is in \
1919-
progress."
1920-
() ;
19211916
error Api_errors.apply_updates_in_progress []
19221917
~doc:
19231918
"The operation could not be performed because applying updates is in \

ocaml/xapi-consts/api_errors.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,8 +1261,6 @@ let invalid_repomd_xml = "INVALID_REPOMD_XML"
12611261

12621262
let get_updates_failed = "GET_UPDATES_FAILED"
12631263

1264-
let get_updates_in_progress = "GET_UPDATES_IN_PROGRESS"
1265-
12661264
let apply_updates_in_progress = "APPLY_UPDATES_IN_PROGRESS"
12671265

12681266
let apply_updates_failed = "APPLY_UPDATES_FAILED"

ocaml/xapi/xapi_pool_helpers.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ let blocking_ops =
3636
; (`tls_verification_enable, Api_errors.tls_verification_enable_in_progress)
3737
; (`configure_repositories, Api_errors.configure_repositories_in_progress)
3838
; (`sync_updates, Api_errors.sync_updates_in_progress)
39-
; (`get_updates, Api_errors.get_updates_in_progress)
4039
; (`apply_updates, Api_errors.apply_updates_in_progress)
4140
]
4241

@@ -52,6 +51,7 @@ let wait_ops =
5251
; `exchange_ca_certificates_on_join
5352
; `copy_primary_host_certs
5453
; `eject
54+
; `get_updates
5555
]
5656

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

0 commit comments

Comments
 (0)