Skip to content

[Nexthop] Use FbossError instead of SIGABRT for invalid min capacity percentage in aggregatePort configs - #1616

Open
vvasavada-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:use-fbosserror-instead-of-sigabrt
Open

[Nexthop] Use FbossError instead of SIGABRT for invalid min capacity percentage in aggregatePort configs#1616
vvasavada-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:use-fbosserror-instead-of-sigabrt

Conversation

@vvasavada-nexthop

Copy link
Copy Markdown
Contributor

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

Previously, an invalid minimumCapacity in an aggregate port config would trip a raw CHECK in computeMinimumLinkCount, aborting the agent with SIGABRT:

F20260908 17:41:52.271183 18014 ApplyThriftConfig.cpp:3611] Check failed: minCapacity.get_linkPercentage() <= 1 (50 vs. 1)

This PR replaces those CHECKs with FbossError throws so invalid config is rejected with a clear, actionable message instead of crashing.

Test Plan

Unit tests

Added AggregatePort.invalidMinimumCapacityLinkPercentageThrows and AggregatePort.invalidMinimumCapacityLinkCountThrows in AggregatePortTests.cpp, asserting publishAndApplyConfig throws FbossError for out-of-range linkPercentage (50) and linkCount (0).

On-device verification

  1. Boot path — clear FATAL message instead of raw CHECK

Running the fixed fboss_sw_agent against a config with minimumCapacity.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 50

  1. Runtime reload path — config rejected, agent stays alive

With the agent booted on a valid config, restoring the invalid linkPercentage: 50 on disk and running fboss2-dev config reload hitless:

  CLI output (exit 1):
  localhost: Thrift call failed: 'facebook::fboss::FbossError: Minimum capacity linkPercentage must be in (0, 1], got 50'

Agent log:

  V0908 18:17:34.977625 24260 ThriftHandler.cpp:2755] reloadConfig thrift request received from ::1 (unknown)
  V0908 18:17:34.978168 24193 SwSwitch.cpp:1993] preparing state update reload config initiated by thrift call; # Pending updates 0
  V0908 18:17:34.979446 24260 ThriftHandler.cpp:2755] reloadConfig thrift request failed in 1ms
  E20260908 18:17:34.979475 24210 service_tcc.h:152] Service handler threw an uncaught exception in method reloadConfig: facebook::fboss::FbossError: Minimum capacity linkPercentage must be in (0, 1], got 50.

Agent survived the rejection — same PID before and after, service still active:

PID before reload: 24161
PID after reload:  24161
fboss_sw_agent.service: active

… in aggregatePort configs

Signed-off-by: Vishrant Vasavada <vvasavada@nexthop.ai>
@vvasavada-nexthop
vvasavada-nexthop requested a review from a team as a code owner September 9, 2026 02:29
@meta-cla meta-cla Bot added the CLA Signed label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant