Comment 2 for bug 1843493

Revision history for this message
Pedro GuimarĂ£es (pguimaraes) wrote :

I've tried to modify maasserver/forms/pods.py's compose method to something like: https://pastebin.canonical.com/p/vVZQN5GKPs/

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