Skip to content

fix(srv6): don't wedge EgressPolicy in Terminating on un-encodable withdraw#17

Merged
ryskn merged 1 commit into
dev/srv6egress-v1from
fix/srv6-finalizer-deadlock
Jul 3, 2026
Merged

fix(srv6): don't wedge EgressPolicy in Terminating on un-encodable withdraw#17
ryskn merged 1 commit into
dev/srv6egress-v1from
fix/srv6-finalizer-deadlock

Conversation

@ryskn

@ryskn ryskn commented Jul 3, 2026

Copy link
Copy Markdown
Owner

What

reconcileDelete returned any error from rebuilding the withdraw advert, blocking finalizer removal. Under the default --bgp-encoding=sr-policy, BuildPath fails permanently when BSID/EndpointAddr is empty, and config.Validate treats bsid as optional — so a bsid-less color never goes Ready yet carries a non-nil status.SRPolicy. Deleting it made Withdraw fail every reconcile → object stuck in Terminating forever. Nothing was ever announced, so the block was pure downside.

Fix

  • reconcileDelete calls adv.BuildPath() first: deterministic encode failures log-and-drop the finalizer (nothing to withdraw); only transient transport errors keep the finalizer and retry
  • main.go requires a bsid per color when --bgp-encoding=sr-policy (fail fast at load)

Review finding

Medium #10, corroborated by cp-correctness (3/3) and error-handling (2/2).

Test

go test ./srv6egress/internal/controller/... green (control-plane runs natively).

…thdraw

reconcileDelete rebuilt the withdraw advert from status.SRPolicy and
returned any error, blocking finalizer removal. Under the default
--bgp-encoding=sr-policy, BuildPath fails permanently when BSID or
EndpointAddr is empty, and config.Validate treats bsid as optional, so a
bsid-less color never goes Ready yet carries a non-nil status.SRPolicy.
Deleting it made Withdraw fail every reconcile, wedging the object in
Terminating (freeable only by manually patching finalizers). Nothing was
ever announced, so the block was pure downside.

- reconcileDelete now calls BuildPath() first to separate deterministic
  encode failures (log and drop the finalizer — nothing to withdraw) from
  transient transport errors (keep the finalizer and retry)
- main.go requires a bsid per color when --bgp-encoding=sr-policy, failing
  fast at load rather than reaching the un-deletable state
@ryskn ryskn merged commit eca17a4 into dev/srv6egress-v1 Jul 3, 2026
1 check passed
@ryskn ryskn deleted the fix/srv6-finalizer-deadlock branch July 3, 2026 00:52
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.

1 participant