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 exit after configuring incorrect advertised interface type value #7768

Closed
Junchao-Mellanox opened this issue Jun 1, 2021 · 6 comments
Assignees

Comments

@Junchao-Mellanox
Copy link
Collaborator

Description

Orchagent exit after configuring incorrect advertised interface type value. But it seems that this is by design, see sonic-net/sonic-swss#1665. In the PR, it introduces a new way to handle SAI return value.

task_process_status Orch::handleSaiSetStatus(sai_api_t api, sai_status_t status, void *context)
{
    /*
     * This function aims to provide coarse handling of failures in sairedis set
     * operation (i.e., notify users by throwing excepions when failures happen).
     * Return value: task_success - Handled the status successfully. No need to retry this SAI operation.
     *               task_need_retry - Cannot handle the status. Need to retry the SAI operation.
     *               task_failed - Failed to handle the status but another attempt is unlikely to resolve the failure.
     * TODO: 1. Add general handling logic for specific statuses
     *       2. Develop fine-grain failure handling mechanisms and replace this coarse handling
     *          in each orch.
     *       3. Take the type of sai api into consideration.
     */
    switch (status)
    {
        case SAI_STATUS_SUCCESS:
            SWSS_LOG_WARN("SAI_STATUS_SUCCESS is not expected in handleSaiSetStatus");
            return task_success;
        default:
            SWSS_LOG_ERROR("Encountered failure in set operation, exiting orchagent, SAI API: %s, status: %s",
                        sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str());
            exit(EXIT_FAILURE);
    }
    return task_need_retry;
}

It just exit if the SAI return value is not SAI_STATUS_SUCCESS. To me, it looks like too strict. In my case, I configured port adv_speeds=100G, adv_interface_types=CR (correct value should be CR4), SAI returned and orchagent just exited. Maybe we should provide a way for user to correct his/her configuration? Or is there a known better way to handle such case?

Related log:

Jun  1 03:35:22.172518 r-leopard-41 ERR swss#orchagent: :- set: set status: SAI_STATUS_INVALID_ATTR_VALUE_0
Jun  1 03:35:22.172518 r-leopard-41 ERR swss#orchagent: :- handleSaiSetStatus: Encountered failure in set operation, exiting orchagent, SAI API: SAI_API_PORT, status: SAI_STATUS_INVALID_ATTR_VALUE_0

Steps to reproduce the issue:

  1. config interface autoneg Ethernet0 enabled
  2. config interface advertised-speeds Ethernet0 100000
  3. config interface advertised-types Ethernet0 CR

Describe the results you received:

Orchagent exited.

Describe the results you expected:

Orchagent should not exit.

Output of show version:

Master branch hash 6616c1b

(paste your output here)

Output of show techsupport:

N/A

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

@Junchao-Mellanox
Copy link
Collaborator Author

@qiluo-msft @shi-su Much appreciate if you could take a look.

@qiluo-msft
Copy link
Collaborator

Thanks Junchao for the bug report!
@shi-su Could you check and improve?

@shi-su
Copy link
Contributor

shi-su commented Jun 1, 2021

Thanks Junchao for the bug report!
@shi-su Could you check and improve?

Ack. I will take a look.

@Junchao-Mellanox
Copy link
Collaborator Author

A WA for this issue: sonic-net/sonic-swss#1906

@liat-grozovik
Copy link
Collaborator

@Junchao-Mellanox and @shi-su is this issue still relevant? if so, @shi-su could you please update?

@prsunny
Copy link
Contributor

prsunny commented May 3, 2022

looks like its fixed as part of sonic-net/sonic-swss#1906. @Junchao-Mellanox , can you please close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants