Skip to content

fix panic when netlink subscription terminates - #133

Merged
Tamas-Biro1 merged 1 commit into
masterfrom
fix-issue-130
Oct 12, 2026
Merged

Tamas-Biro1 merged 1 commit into
masterfrom
fix-issue-130

Conversation

@Tamas-Biro1

@Tamas-Biro1 Tamas-Biro1 commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

This PR fixes the #130

THe problem: static route operator could crash with panic: panic called with nil argument. The reason is that Netlink closes the route update channel on any receive error (e.g. ENOBUFS), so RouteManager.Run() then returned nil, and main.go called panic(nil) with it.

In this PR:

  • RouteManager.Run() now subscribes again when Netlink closes the update channel, so the operator keeps running instead of crashing
  • Run() returns nil only when stopChan is closed, and returns a wrapped error if the subscription fails
  • main.go no longer calls panic(nil):
    • if the route manager exits, the operator panics with the error it returned, or with route manager stopped unexpectedly if it returned nil
    • if the StaticRoute CRD is missing, it panics with CRD not found: staticroutes.static-route.ibm.com
  • updated unit tests

Signed-off-by: Tamas-Biro1 <60390128+Tamas-Biro1@users.noreply.github.com>

@mihivagyok mihivagyok left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@Tamas-Biro1
Tamas-Biro1 merged commit 4d3b222 into master Oct 12, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants