From 7bd250897b8bf2d55d8211e9cd7aa54c6a2d0897 Mon Sep 17 00:00:00 2001 From: chenglch Date: Thu, 19 Oct 2017 10:23:26 +0800 Subject: [PATCH] Use green sleep to help retry the request As sleep may block the main thread, this commit compare the timestamp with the node timer in the main loop to avoid of the blocking. --- xCAT-server/lib/xcat/plugins/openbmc.pm | 75 ++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 21f52c628..54381f481 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -55,6 +55,10 @@ $::UPLOAD_AND_ACTIVATE = 0; $::NO_ATTRIBUTES_RETURNED = "No attributes returned from the BMC."; +$::UPLOAD_WAIT_ATTEMPT = 6; +$::UPLOAD_WAIT_INTERVAL = 10; +$::UPLOAD_WAIT_TOTALTIME = int($::UPLOAD_WAIT_ATTEMPT*$::UPLOAD_WAIT_INTERVAL); + sub unsupported { my $callback = shift; if (defined($::OPENBMC_DEVEL) && ($::OPENBMC_DEVEL eq "YES")) { @@ -358,6 +362,10 @@ my %next_status = (); my %handle_id_node = (); +# Store the value format like ' =>