Skip to content
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

orchagent core dump when executing with -s option (syncMode) #1014

Merged
merged 1 commit into from
Aug 5, 2019
Merged
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
20 changes: 12 additions & 8 deletions orchagent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,9 @@ int main(int argc, char **argv)
attrs.push_back(attr);
}

status = sai_switch_api->create_switch(&gSwitchId, (uint32_t)attrs.size(), attrs.data());
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to create a switch, rv:%d", status);
exit(EXIT_FAILURE);
}
SWSS_LOG_NOTICE("Create a switch");

// SAI_REDIS_SWITCH_ATTR_SYNC_MODE attribute only setBuffer and g_syncMode to true
// since it is not using ASIC_DB, we can execute it before create_switch
// when g_syncMode is set to true here, create_switch will wait the response from syncd
if (gSyncMode)
{
attr.id = SAI_REDIS_SWITCH_ATTR_SYNC_MODE;
Expand All @@ -236,6 +231,15 @@ int main(int argc, char **argv)
sai_switch_api->set_switch_attribute(gSwitchId, &attr);
}


status = sai_switch_api->create_switch(&gSwitchId, (uint32_t)attrs.size(), attrs.data());
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to create a switch, rv:%d", status);
exit(EXIT_FAILURE);
}
SWSS_LOG_NOTICE("Create a switch");

kcudnik marked this conversation as resolved.
Show resolved Hide resolved
/* Get switch source MAC address if not provided */
if (!gMacAddress)
{
Expand Down