Skip to content

RBMC: Check again for dead sibling service #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions redundant-bmc/src/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Manager::Manager(sdbusplus::async::context& ctx,
ctx.spawn(startup());
}

// clang-tidy currently mangles this into something unreadable
// NOLINTNEXTLINE
sdbusplus::async::task<> Manager::startup()
{
Expand All @@ -70,13 +69,20 @@ sdbusplus::async::task<> Manager::startup()
{
co_await sibling->waitForSiblingUp(siblingTimeout);

if (previousRole == Role::Passive)
// Sibling service may have died. Check again.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've looked at this for a while now, and I'm sure it's right, but it just feels like we're starting to work ourselves into the if/else wormhole. With tests now needed for every path and just a lot of complexity. Is that sibling service dying a real use case? Or just something that was only possible with some special error injections?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It happened when the cfam daemon failed accessing the CFAM regs, which I think is a valid fail, and right now I just have the daemon crash when that happens. I did it that way because I couldn't think of how else to alert rbmc manager that the sibling can't get any info from it. If there would be another way for the rbmc manager to know that FSI is broken, then I wouldn't worry about this case here. I'll think a bit more on it.

if (!sibling->getInterfacePresent())
{
passiveRoleInfo = co_await determinePassiveRoleIfRequired();
}

// If passive previously, let sibling go first.
if (!passiveRoleInfo && (previousRole == Role::Passive))
{
co_await sibling->waitForSiblingRole();
}
}

updateRole(determineRole());
updateRole(passiveRoleInfo.value_or(determineRole()));
}

spawnRoleHandler();
Expand Down Expand Up @@ -116,7 +122,6 @@ void Manager::startHeartbeat()
ctx.spawn(doHeartBeat());
}

// clang-tidy currently mangles this into something unreadable
// NOLINTNEXTLINE
sdbusplus::async::task<> Manager::doHeartBeat()
{
Expand Down