From 77333eed964b11c7b210f14f3847a7f46f203130 Mon Sep 17 00:00:00 2001 From: Bengang Yuan Date: Fri, 2 Aug 2024 09:36:19 +0100 Subject: [PATCH] CP-49526: Resolve non-CDN design comments 1 Change the max total bundle files size limit to 1G. 2 Change HTTP error code for `bundle_repo_not_enabled` to 400. Signed-off-by: Bengang Yuan --- ocaml/xapi/xapi_globs.ml | 4 ++-- ocaml/xapi/xapi_pool.ml | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ocaml/xapi/xapi_globs.ml b/ocaml/xapi/xapi_globs.ml index cdb1cc40144..02ce727a6a1 100644 --- a/ocaml/xapi/xapi_globs.ml +++ b/ocaml/xapi/xapi_globs.ml @@ -957,8 +957,8 @@ let ignore_vtpm_unimplemented = ref false let evacuation_batch_size = ref 10 -(* Max size limit of bundle file: 500 MB*) -let bundle_max_size_limit = ref (Int64.of_int (500 * 1024 * 1024)) +(* Max size limit of bundle file: 1 GB*) +let bundle_max_size_limit = ref (Int64.of_int (1024 * 1024 * 1024)) type xapi_globs_spec = | Float of float ref diff --git a/ocaml/xapi/xapi_pool.ml b/ocaml/xapi/xapi_pool.ml index 6176729caa4..7ae0e8b33e4 100644 --- a/ocaml/xapi/xapi_pool.ml +++ b/ocaml/xapi/xapi_pool.ml @@ -3806,5 +3806,8 @@ let put_bundle_handler (req : Request.t) s _ = Http_svr.headers s (Http.http_400_badrequest ()) ) | `remote -> - raise Api_errors.(Server_error (bundle_repo_not_enabled, [])) + error "%s: Bundle repo is not enabled" __FUNCTION__ ; + TaskHelper.failed ~__context + Api_errors.(Server_error (bundle_repo_not_enabled, [])) ; + Http_svr.headers s (Http.http_400_badrequest ()) )