The idea was to wait for 10s every time I receive OperationalError as an exception. However, I am seeing now TransactionManagementError poping up on the logs: https://pastebin.canonical.com/p/WNcvjXqRDg/
I believe there is a race-condition, since building a VM means updating resource consumption for its host, if I have two requests in parallel for VMs like:
1) First request for VM
2) SELECT all commit-related info
3) Second request for VM
4) select all commit-related info
5) Picked node for first request -> update committed resources info for first request
6) Second request fails because it was based on old info
I've tried to modify maasserver/ forms/pods. py's compose method to something like: https:/ /pastebin. canonical. com/p/vVZQN5GKP s/
The idea was to wait for 10s every time I receive OperationalError as an exception. However, I am seeing now TransactionMana gementError poping up on the logs: https:/ /pastebin. canonical. com/p/WNcvjXqRD g/
I believe there is a race-condition, since building a VM means updating resource consumption for its host, if I have two requests in parallel for VMs like:
1) First request for VM
2) SELECT all commit-related info
3) Second request for VM
4) select all commit-related info
5) Picked node for first request -> update committed resources info for first request
6) Second request fails because it was based on old info