Apache CloudStack
āMergedApache Software Foundation Ā· Release 4.22.2 Ā· PR #13700 Ā· Sep 2026
Fixed a concurrency race that silently left VM network interfaces attached
The Bug
CloudStack is the orchestration engine underneath Apiculus. If two API calls detached different NICs from the same VM at the same time, the async work-job queue treated them as duplicates and ran only one of them. Both calls still returned success, so the VM kept a NIC that the control plane had already written off as removed.
The Fix
The pending-work-job lookup keyed only on VM ID, the same mistake that had been fixed on the attach path years earlier. I re-keyed the deduplication on the NIC UUID so two detaches of different NICs stop colliding, and added regression tests that fail on the old code and pass on the new. One of the CloudStack committers reproduced the race on a live deployment before approving: two detach calls five seconds apart, both returning success with the NICs still attached, both cleared once the patch was in.
3
Regression tests
3
Committer approvals
149
CI smoke tests green
+106/-3
Lines changed




