|
|
|
|
|
|
|
|
|
|
xen-api
[Xen-API] [PATCH] Add separate timeout for WLB reports
CA-30877: Executing WLB reports occasionally results in timeout error
We currently have one timeout for all WLB commands, defaulting to 30 seconds,
but it is not unusual for WLB reports to take longer than 30 seconds to
generate and download.
Add a separate timeout for WLB report generation, defaulting to 10 minutes.
Signed-off-by: Ewan Mellor <ewan.mellor@xxxxxxxxxxxxx>
diff -r 757f121d05ca ocaml/xapi/workload_balancing.ml
--- a/ocaml/xapi/workload_balancing.ml Wed Jan 20 18:26:19 2010 +0000
+++ b/ocaml/xapi/workload_balancing.ml Fri Jan 22 23:26:03 2010 +0000
@@ -270,7 +270,7 @@
"Logging output disabled for this call."
(* This function handles the actual network request and deals with any errors
relating to the connection *)
-let wlb_request ~__context ~host ~port ~auth ~meth ~params ~handler
~enable_log =
+let wlb_request ~__context ~host ~port ~auth ~meth ~params ~handler
~enable_log ~timeout_key ~timeout_default =
let body = wlb_body meth params in
let headers = wlb_headers host meth (String.length body) auth in
let pool = Helpers.get_pool ~__context in
@@ -278,13 +278,13 @@
let pool_other_config = Db.Pool.get_other_config ~__context ~self:pool in
let timeout =
try
- if List.mem_assoc Xapi_globs.wlb_timeout pool_other_config then
- float_of_string (List.assoc Xapi_globs.wlb_timeout pool_other_config)
+ if List.mem_assoc timeout_key pool_other_config then
+ float_of_string (List.assoc timeout_key pool_other_config)
else
- Xapi_globs.default_wlb_timeout
+ timeout_default
with
| _ ->
- Xapi_globs.default_wlb_timeout
+ timeout_default
in
if enable_log then
debug "%s\n%s" (String.concat "\n" (filtered_headers headers)) body;
@@ -355,6 +355,8 @@
error enable_log)
in
wlb_request ~__context ~host ~port ~auth:auth' ~meth ~params
+ ~timeout_key:Xapi_globs.wlb_timeout
+ ~timeout_default:Xapi_globs.default_wlb_timeout
~handler:check_response ~enable_log;
match !result with
| Some s -> s
@@ -703,6 +705,8 @@
let auth = wlb_encoded_auth ~__context in
wlb_request ~__context ~host ~port ~auth ~meth ~params ~handler
~enable_log:true
+ ~timeout_key:Xapi_globs.wlb_reports_timeout
+ ~timeout_default:Xapi_globs.default_wlb_reports_timeout
let wlb_report_request report params =
let meth = "ExecuteReport" in
diff -r 757f121d05ca ocaml/xapi/xapi_globs.ml
--- a/ocaml/xapi/xapi_globs.ml Wed Jan 20 18:26:19 2010 +0000
+++ b/ocaml/xapi/xapi_globs.ml Fri Jan 22 23:26:03 2010 +0000
@@ -477,7 +477,9 @@
let dev_zero = "/dev/zero"
let wlb_timeout = "wlb_timeout"
+let wlb_reports_timeout = "wlb_reports_timeout"
let default_wlb_timeout = 30.0
+let default_wlb_reports_timeout = 600.0
(** {2 Settings relating to dynamic memory control} *)
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Xen-API] [PATCH] Add separate timeout for WLB reports,
Ewan Mellor <=
|
|
|
|
|