Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39481

Handle HTTP return code 406 during reservation as a correct possible state

XMLWordPrintable

      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.

            pajasoft Pavel Janoušek
            pajasoft Pavel Janoušek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: