Repository navigation
[AAP-96820] Separate heartbeat adoption decisions from their side effects - #16728
Draft
chrismeyersfsu wants to merge 3 commits into
Draft
chrismeyersfsu wants to merge 3 commits into
chrismeyersfsu wants to merge 3 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true |
✅ Test Results - PASSEDSummary
Pass Rate: 88.8% |
Member
Author
|
/run-atf-tests |
✅ Test Results - PASSEDSummary
Pass Rate: 88.8% |
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
from
October 12, 2026 13:17
7dba4c3 to
ef5a174
Compare
❌ Test Results - FAILEDSummary
Pass Rate: 88.6% ❌ Failed Tests
|
8000
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
from
October 13, 2026 10:40
28b0bc8 to
e2603f4
Compare
❌ Test Results - FAILEDSummary
Pass Rate: 88.2% ❌ Failed Tests
|
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
from
October 14, 2026 15:14
e2603f4 to
e573392
Compare
❌ Test Results - FAILEDSummary
Pass Rate: 88.5% ❌ Failed Tests
|
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
from
October 14, 2026 22:00
e573392 to
bc719b6
Compare
✅ Test Results - PASSEDSummary
Pass Rate: 88.8% |
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
3 times, most recently
from
October 21, 2026 13:17
d073ad5 to
b62f9f5
Compare
✅ Test Results - PASSEDSummary
Pass Rate: 88.8% |
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
2 times, most recently
from
October 22, 2026 13:53
90ad243 to
99a55bd
Compare
✅ Test Results - PASSEDSummary
Pass Rate: 88.8% |
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
3 times, most recently
from
October 23, 2026 14:00
12733ad to
80530d6
Compare
✅ Test Results - PASSEDSummary
Pass Rate: 88.8% |
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
from
October 27, 2026 12:32
80530d6 to
53809c1
Compare
✅ Test Results - PASSEDSummary
Pass Rate: 88.8% |
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
from
October 27, 2026 14:21
53809c1 to
d750810
Compare
✅ Test Results - PASSEDSummary
Pass Rate: 88.8% |
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
from
October 27, 2026 18:04
d750810 to
97b9f22
Compare
✅ Test Results - PASSEDSummary
Pass Rate: 88.8% |
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
from
October 28, 2026 22:38
97b9f22 to
c8ab93f
Compare
❌ Test Results - FAILEDSummary
Pass Rate: 88.5% ❌ Failed Tests
|
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
2 times, most recently
from
November 3, 2026 12:51
942011b to
6bd9565
Compare
✅ Test Results - PASSEDSummary
Pass Rate: 88.8% |
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
from
November 4, 2026 15:34
6bd9565 to
e0dbc2a
Compare
✅ Test Results - PASSEDSummary
Pass Rate: 88.8% |
3 of 8 tasks
Move the decisions the heartbeat makes about lost instances and orphaned jobs into awx.main.tasks.adoption_decisions: which peers are lost, which lost instances the mesh gate lets through, what happens to a lost instance and its jobs, whether a running job is adopted, reaped or left alone, and whether an orphan is past the adoption deadline. The functions read plain attributes and touch no database, receptor or dispatcher, so they can be tested with simple objects. awx.main.tasks.system keeps the queries and side effects and calls the decisions. Behavior is unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
gate_lost_instances now takes the mesh check as a callable and skips it when nothing is lost, so the heartbeat has no branch of its own there. New tests cover a lost instance's job the decision doesn't reap, and a heartbeat job the decision skips. Co-Authored-By: Claude <noreply@anthropic.com>
Cases that differ only in their inputs are now rows of one test, each named by its id. Co-Authored-By: Claude <noreply@anthropic.com>
chrismeyersfsu
force-pushed
the
cmeyers-adoption-seam1-decisions
branch
from
November 5, 2026 18:35
e0dbc2a to
110ad27
Compare
|
✅ Test Results - PASSEDSummary
Pass Rate: 88.8% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



SUMMARY
The heartbeat's decisions about lost instances and orphaned jobs are mixed in with the queries, receptor calls and dispatcher calls that act on them. Testing a decision today means setting up all of that, which in practice means a running cluster.
This moves the decisions into
awx/main/tasks/adoption_decisions.py. They read plain attributes and touch no database, receptor or dispatcher:find_lost_instancesgate_lost_instanceslost_instance_job_actionlost_instance_dispositionstartup_job_actionrunning_job_actionadoption_deadline_passedHADR_JOB_ADOPTION_TIMEOUTawx/main/tasks/system.pykeeps its queries and side effects and calls these. Behavior is unchanged. The query in_process_running_jobsstill narrows the candidates;running_job_actionrepeats its conditions so the decision is complete and testable on its own.Why: cross-controller adoption (AAP-89602, #16669) adds several new decisions here: when a controller is really gone, whether there is capacity to adopt, and who owns a claimed job. Failure testing of #16669 on a docker-compose cluster turned up defects in exactly these decisions: a slow controller judged lost while still running, claims at zero capacity, and a silent playbook timed out as dead. Each of those took a cluster run of 5 to 25 minutes to reproduce. With the decisions separated, the same cases are table-driven unit tests that run in milliseconds. A few such cases are included as examples (slow controller, clock skew, quiet job). They document today's behavior; they do not change it.
ISSUE TYPE
COMPONENT NAME
STEPS TO REPRODUCE AND EXTRA INFO