<fix>[port-forwarding]: avoid stale binding on invalid nic attach#4416
<fix>[port-forwarding]: avoid stale binding on invalid nic attach#4416ZStack-Robot wants to merge 1 commit into
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 33 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Warning
|
750caf7 to
1f75188
Compare
Port forwarding attach/create wrote vmNicUuid and guestIp before validating that the target VM NIC L3 had PortForwarding service. When a public NIC without the service was selected, the API failed with ORG_ZSTACK_NETWORK_SERVICE_10005 but left the PF rule half-bound in DB, blocking later detach and delete. Validate the target NIC L3 provider before persisting binding fields, clear binding fields on attach failure, and allow detach/delete/release flows to clean existing stale bindings when the stored NIC L3 has no PortForwarding provider. Resolves: ZSTAC-86549 Change-Id: I40838c799cb0fbf6a7f086d6e3ee830e41c4c408
1f75188 to
7ae2aec
Compare
Root cause: PortForwarding attach/create wrote PortForwardingRuleVO.vmNicUuid and guestIp before validating whether the target VM NIC L3 had PortForwarding service enabled. Binding a public NIC without that service failed with ORG_ZSTACK_NETWORK_SERVICE_10005 but left the rule half-bound in DB, so later detach/delete failed on the same provider lookup.
Fix solution: validate the target NIC L3 provider before persisting PF binding fields, clear binding fields on attach failure, and let detach/delete/release clean existing stale bindings when the stored NIC L3 has no PortForwarding provider.
Tested: git diff --check
Not-tested: mvn test -Djacoco.skip=true -Dtest=TestVirtualRouterPortForwarding36 (mvn not installed in local PATH)
Resolves: ZSTAC-86549
sync from gitlab !10378