[Nexthop] Use FbossError instead of SIGABRT for invalid min capacity percentage in aggregatePort configs - #1616
Open
vvasavada-nexthop wants to merge 1 commit into
Conversation
… in aggregatePort configs Signed-off-by: Vishrant Vasavada <vvasavada@nexthop.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
Previously, an invalid
minimumCapacityin an aggregate port config would trip a rawCHECKincomputeMinimumLinkCount, aborting the agent withSIGABRT:F20260908 17:41:52.271183 18014 ApplyThriftConfig.cpp:3611] Check failed: minCapacity.get_linkPercentage() <= 1 (50 vs. 1)This PR replaces those
CHECKs withFbossErrorthrows so invalid config is rejected with a clear, actionable message instead of crashing.Test Plan
Unit tests
Added
AggregatePort.invalidMinimumCapacityLinkPercentageThrowsandAggregatePort.invalidMinimumCapacityLinkCountThrowsinAggregatePortTests.cpp, assertingpublishAndApplyConfigthrowsFbossErrorfor out-of-rangelinkPercentage(50) andlinkCount(0).On-device verification
FATALmessage instead of rawCHECKRunning the fixed
fboss_sw_agentagainst a config withminimumCapacity.linkPercentage = 50:F0908 18:12:48.950331 24000 SwAgentInitializer.cpp:116] switch initialization failed: facebook::fboss::FbossError: Minimum capacity linkPercentage must be in (0, 1], got 50With the agent booted on a valid config, restoring the invalid
linkPercentage: 50on disk and runningfboss2-dev config reload hitless:Agent log:
Agent survived the rejection — same PID before and after, service still active: