Skip to content
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
4 changes: 3 additions & 1 deletion orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ void PortsOrch::doPortTask(Consumer &consumer)
}

Port p;
if (!getPort(alias, p))
if (!getPort(alias, p) && alias != "PortConfigDone")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The PORT_TABLE contains two non-port "flag" entries: PortConfigDone and PortInitDone. You will probably want to ignore both.

We really need to devise a way to remove them from the table. They don't belong there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Joe, I agree with you, but in this PR I want to make a fast fix of the wrong error message.
I don't want to change the swss architecture in this PR

Copy link
Copy Markdown
Contributor

@jleveque jleveque May 14, 2018

Choose a reason for hiding this comment

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

Understood. For this PR I suggest you also ignore PortInitDone. Do we not see a similar error message for PortInitDone?

Changing the underlying architecture is a TODO for the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We don't see PortInitDone because the code exits from the method as soon as it sees alias 'PortInitDone'.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agree with you both, we should find a new location in redisDB for all this metadata, or identify a different channel to transfer this state. PortInitDone and PortConfigDone are not the only cases, we also have "CONFIG_DB_INITIALIZED" and i'm sure i'm missing one or two examples more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks like it is late in the review since it is "merged", but to not calling the getPort unnecessarily , we should use below logic:

        if (alias == "PortConfigDone" || !getPort(alias, p))
        {
            if (alias != "PortConfigDone")
            {
                SWSS_LOG_ERROR("Failed to get port id by alias:%s", alias.c_str());
            }
        }

{
SWSS_LOG_ERROR("Failed to get port id by alias:%s", alias.c_str());
}
Expand Down Expand Up @@ -1332,7 +1332,9 @@ void PortsOrch::doPortTask(Consumer &consumer)
}
}
else
{
SWSS_LOG_ERROR("Unknown operation type %s", op.c_str());
}

it = consumer.m_toSync.erase(it);
}
Expand Down