Skip to content

Commit

Permalink
Add BMC Dump when timeout (#1119)
Browse files Browse the repository at this point in the history
Have this defect 661124 where we are seeing the code update timeout.
Have no idea what is slowing things down so this adds code to get a dump
after it times out.

Tested: Lowered this timeout to 2 seconds and see the dump generated.

Signed-off-by: Gunnar Mills <[email protected]>
  • Loading branch information
gtmills authored Jan 16, 2025
1 parent 5983f0e commit b83a314
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions redfish-core/lib/update_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,31 @@ static void
}
}

// TODO(Gunnar): Remove this 4/1/25
inline void createBMCDump()
{
std::vector<std::pair<std::string, std::variant<std::string, uint64_t>>>
createDumpParamVec;

createDumpParamVec.emplace_back(
"xyz.openbmc_project.Dump.Create.CreateParameters.OriginatorId",
"bmcweb-internal");
createDumpParamVec.emplace_back(
"xyz.openbmc_project.Dump.Create.CreateParameters.OriginatorType",
"xyz.openbmc_project.Common.OriginatedBy.OriginatorTypes.Internal");

crow::connections::systemBus->async_method_call(
[](const boost::system::error_code& ec) {
if (ec)
{
BMCWEB_LOG_ERROR("Failed to do a dump:{}", ec.value());
return;
}
},
"xyz.openbmc_project.Dump.Manager", "/xyz/openbmc_project/dump/bmc",
"xyz.openbmc_project.Dump.Create", "CreateDump", createDumpParamVec);
}

inline void afterAvailbleTimerAsyncWait(
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const boost::system::error_code& ec)
Expand All @@ -400,6 +425,9 @@ inline void afterAvailbleTimerAsyncWait(
}
BMCWEB_LOG_ERROR("Timed out waiting for firmware object being created");
BMCWEB_LOG_ERROR("FW image may has already been uploaded to server");
// TODO(Gunnar): Remove this 4/1/25, this is here to try to figure what is
// slowing down the system so much.
createBMCDump();
if (ec)
{
BMCWEB_LOG_ERROR("Async_wait failed{}", ec);
Expand Down

0 comments on commit b83a314

Please sign in to comment.