From 491273323f581cb70bc4ba2480ae5f4bc6f8f3d7 Mon Sep 17 00:00:00 2001 From: Amir Date: Tue, 2 Jul 2024 21:20:38 +0300 Subject: [PATCH] Fix in switchorch: unsupported attribute causes skipping of processing the rest of configurations (#3209) What I did Changed it so that if the configuration has an unsupported attribute, it would continue processing the rest of the configuration rather than break out of the loop and end the processing immediately. Also added syslogs to make it more clear. --- orchagent/switchorch.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/orchagent/switchorch.cpp b/orchagent/switchorch.cpp index cd6def1ebc..3e4efa0643 100644 --- a/orchagent/switchorch.cpp +++ b/orchagent/switchorch.cpp @@ -469,11 +469,18 @@ void SwitchOrch::doAppSwitchTableTask(Consumer &consumer) invalid_attr = true; break; } - if (invalid_attr || unsupported_attr) + if (invalid_attr) { /* break from kfvFieldsValues for loop */ + SWSS_LOG_ERROR("Invalid Attribute %s", attribute.c_str()); + // Will not continue to set the rest of the attributes break; } + if (unsupported_attr){ + SWSS_LOG_ERROR("Unsupported Attribute %s", attribute.c_str()); + // Continue to set the rest of the attributes, even if current attribute is unsupported + continue; + } sai_status_t status = sai_switch_api->set_switch_attribute(gSwitchId, &attr); if (status != SAI_STATUS_SUCCESS)