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

[portsorch]: Don't print error when alias equal to PortConfigDone #503

Merged

Conversation

pavel-shirshov
Copy link
Contributor

Don't print 'orchagent: :- doPortTask: Failed to get port id by alias PortConfigDone error'

What I did
Don't print 'orchagent: :- doPortTask: Failed to get port id by alias PortConfigDone error'

Why I did it
Because this error message was an error

How I verified it
Build swss and run it

Details if related

@@ -1220,7 +1220,7 @@ void PortsOrch::doPortTask(Consumer &consumer)
}

Port p;
if (!getPort(alias, p))
if (!getPort(alias, p) && alias != "PortConfigDone")
Copy link
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
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
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
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
Contributor Author

Choose a reason for hiding this comment

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

Copy link
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.

@pavel-shirshov pavel-shirshov merged commit 410b870 into sonic-net:master May 14, 2018
@pavel-shirshov pavel-shirshov deleted the pavelsh/portconfigdone branch May 14, 2018 23:27
@@ -1220,7 +1220,7 @@ void PortsOrch::doPortTask(Consumer &consumer)
}

Port p;
if (!getPort(alias, p))
if (!getPort(alias, p) && alias != "PortConfigDone")
Copy link
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());
            }
        }

EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
* [techsupport] add option to collect logs since given date

Allow user to dump logs newer some specific date to reduce
dump archive size

e.g:

admin@sonic:~$ show techsupport --since=yesterday

Signed-off-by: Stepan Blyschak <[email protected]>

* [generate_dump] add specific error codes

Signed-off-by: Stepan Blyschak <[email protected]>

* [generate_dump] exclude mellanox folders in /etc/

Signed-off-by: Stepan Blyschak <[email protected]>

* [generate_dump] disable logrotate during log collection

Signed-off-by: Stepan Blyschak <[email protected]>

* [generate_dump] add +w for procfs dump files

Signed-off-by: Stepan Blyschak <[email protected]>

* [generate_dump] SINCE_DATE is epoch by default

Signed-off-by: Stepan Blyschak <[email protected]>

* [generate_dump] change find_logs to find_files

Signed-off-by: Stepan Blyschak <[email protected]>

* [generate_dump] add mstdump

Signed-off-by: Stepan Blyschak <[email protected]>

* [generate_dump] fix noop mode when generating sai/sdk/fw dump

Signed-off-by: Stepan Blyschak <[email protected]>
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants