Skip to content

Commit 70d1ce4

Browse files
committed
Fix race condition in route destination updates
Move route.reload inside the transaction block to ensure the returned route reflects a consistent state. Previously, a concurrent request could modify or delete the route between transaction commit and reload.
1 parent c8604dc commit 70d1ce4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/actions/update_route_destinations.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ def update(route, to_add, to_delete, user_audit_info, manifest_triggered)
9292
end
9393

9494
update_processes(processes_to_ports_map)
95-
end
9695

97-
route.reload
96+
route.reload
97+
end
9898

9999
route
100100
end

0 commit comments

Comments
 (0)