Update the MCTP socket timeout On the miniBMC side when the IOC is being reset, the IOC config page read can take longer. Currently the total timeout for the config page read is set to 6 seconds. This config page read happens every time miniBMC receives redfish requests for SATA drive resources. The redfish response timeout on the BMC is set to 1 second. So in any case, if IOC goes of reset, the config page read can easily take more than 2-3 seconds and therefore BMC can timeout. Eventually miniBMC and BMC communication can go out of sync. This can happen when miniBMC is receiving SATA drive resource requests while Host is booting up. During host bootup IOC resets 3 times. So update the BMC MCTP socket timeout to a safe value. Tested: Ran repeated redfish queries for SATA drive resources for over 8 hours on a machine where the Host is bootlooping and on every boot it is resetting IOC 3 times. No issue of miniBMC and BMC going out of sync is observed. Google-Bug-Id: 300946789 Google-Bug-Id: 310061372 Google-Bug-Id: 308729272 Change-Id: Ie2913e8f3c9e13736b3b593b581334b0643cf8b1 Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
diff --git a/rded.cpp b/rded.cpp index 1272643..75b78d3 100644 --- a/rded.cpp +++ b/rded.cpp
@@ -9,6 +9,8 @@ #include <cstddef> #include <string> +constexpr int SOCKET_TIMEOUT_SECONDS = 8; + void setSocketTimeout(int fd, int seconds, int milliseconds) { struct timeval tv; @@ -29,7 +31,8 @@ stdplus::print(stderr, "Socket Created with ID: {}. Setting timeouts...\n", fd); - setSocketTimeout(fd, /*seconds=*/1, /*milliseconds=*/0); + setSocketTimeout(fd, /*seconds=*/SOCKET_TIMEOUT_SECONDS, + /*milliseconds=*/0); socklen_t optLen; int currentSendBuffSize;