Summary
APISIX watcher and gateway claim handling contain confirmed runtime defects.
Findings
Suggested Direction
- Move
Add before goroutine launch or rely solely on errgroup.
- Remove busy default branch and block on channel/ticker.
- Fix claim branch condition for uid.
- Register delete callback in delete hook chain.
Summary
APISIX watcher and gateway claim handling contain confirmed runtime defects.
Findings
High | confirmedWaitGroup.Add(1)occurs after goroutine start and may triggernegative WaitGroup counterpanic.pkg/apisix/watch_sync.go:180,pkg/apisix/watch_sync.go:199,pkg/apisix/watch_sync.go:205,pkg/apisix/watch_sync.go:224High | confirmedwatcher loop usesselect { default: }busy-spin and can consume excessive CPU.pkg/apisix/watch_sync.go:66,pkg/apisix/watch_sync.go:73High | confirmedgateway auth plugin duplicates subject condition and skipsUidfallback branch.gateway/apisix/cmd/go-runner/plugins/kit_authn.go:231High | confirmedaggregate delete callback is registered on update hook, causing delete event publication gap.pkg/gorm/agg.go:80Suggested Direction
Addbefore goroutine launch or rely solely on errgroup.