-
Bug
-
Resolution: Done
-
Critical
-
None
Reservation procedure in ForemanSharedNodeCloud.provision(Label) isn't (and can't be) an atomic operation. There is a time period between check if the host is free (ForemanAPI.isHostFree()) and setting a new value for params.RESERVED (another request in ForemanAPI.reserveHost(String)). There is a possible race condition that just after our check isHostFree() somebody can else successfully reserve the same host and we only rewrite the original cause if it isn't denied by Foreman Reserved plug-in itself.
I'm not sure how Foreman Reserved plug-in works and if it denies such a situation, but based on the test and body3.txt, we should here test the RESERVED status retrieved in the JsonNode object.