Skip to content

RBMC: Check again for dead sibling service #77

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

Open
wants to merge 1 commit into
base: 1120
Choose a base branch
from
Open
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 @@ -49,7 +49,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 @@ -72,13 +71,20 @@ sdbusplus::async::task<> Manager::startup()
{
co_await sibling->waitForSiblingUp(siblingTimeout);

if (previousRole == Role::Passive)
// Sibling service may have died. Check again.
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 @@ -118,7 +124,6 @@ void Manager::startHeartbeat()
ctx.spawn(doHeartBeat());
}

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