Commit 41d16f8
committed
Fix cfn-hup endless loop after rollback to cluster state older than 24h
When a cluster update fails and triggers a rollback to a state older than
24 hours, cfn-hup enters an endless loop on the head node. This happens
because:
1. The rollback restores the launch template metadata to reference an
expired wait condition handle (wait conditions expire after 24h)
2. cfn-signal fails to signal the expired handle and returns non-zero
3. cfn-hup sees the non-zero exit code and does not update its local
metadata cache (metadata_db.json)
4. On the next polling interval, cfn-hup detects the same "change" and
re-triggers the update recipe, creating an infinite loop
This fix appends "; exit 0" to the update command, ensuring cfn-hup
always updates its metadata cache regardless of whether cfn-signal
succeeds or fails. This prevents the endless loop while still allowing
CloudFormation to handle timeouts appropriately.1 parent c16d21a commit 41d16f8
2 files changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1496 | 1496 | | |
1497 | 1497 | | |
1498 | 1498 | | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
1499 | 1506 | | |
1500 | 1507 | | |
1501 | 1508 | | |
| |||
1508 | 1515 | | |
1509 | 1516 | | |
1510 | 1517 | | |
1511 | | - | |
| 1518 | + | |
| 1519 | + | |
1512 | 1520 | | |
1513 | 1521 | | |
1514 | 1522 | | |
| |||
0 commit comments