ironic-python-agent/releasenotes/notes/understand-node-conflict-is-locked-2ea21dd45abfe4f7.yaml
Julia Kreger 5ed520df89 Handle the node being locked
If the node is locked, a lookup cannot be performed when an agent
token needs to be generated, which tends to error like this:

  ironic_python_agent.ironic_api_client [-] Failed looking up node
  with addresses '00:6f:bb:34:b3:4d,00:6f:bb:34:b3:4b' at
  https://172.22.0.2:6385. Error 409: Node
  c25e451b-d2fb-4168-b690-f15bc8365520 is locked by host 172.22.0.2,
  please retry after the current operation is completed..
  Check if inspection has completed.

Problem is, if we keep pounding on the door, we can actually worsen
the situation, and previously we would just just let tenacity
retry.

We will now hold for 30 seconds before proceeding, so we have
hopefully allowed the operation to complete.

Also fixes the error logging to help human's sanity.

Change-Id: I97d3e27e2adb731794a7746737d3788c6e7977a0
2023-08-22 16:47:28 -07:00

14 lines
698 B
YAML

---
fixes:
- |
Fixes, or at least lessens the case where a running Ironic agent can stack
up numerous lookup requests against an Ironic deployment when a node is
locked. In particular, this is beause the lookup also drives generation of
the agent token, which requires the conductor to allocate a worker, and
generate the token, and return the result to the API client.
Ironic's retry logic will now wait up to ``60`` seconds, and if an HTTP
Conflict (409) message is received, the agent will automatically pause
lookup operations for thirty seconds as opposed continue to attempt
lookups which could create more work for the Ironic deployment
needlessly.