feat(worker-join-refactor): implement apply_join_state, init_worker, rejoin_worker
Replace monolithic add_worker with three focused functions: - apply_join_state (static under production, exported under XCE_TESTING): shared status/resource update called by both create and rejoin paths; clears XCE_WORKER_UNAVAIL, applies hconfig overrides, updates resources - init_worker: first-time join path via makeWorker + apply_join_state - rejoin_worker: reconnect path with explicit admin-bit preservation (XCE_WORKER_ADMIN_MASK = LOCKEDU|CLOSED|HIDDEN|CLOSED_BY_ADMIN) Also makes find_matched_hostconfig non-static so join.c can call it via the extern declaration already in worker.h. Removes add_worker (no longer declared in worker.h, no callers). All 7 tests in test_worker_join pass: apply_join_state (clears UNAVAIL, hosttype override, resource values), init_worker (creates entry, returns correct idx), rejoin_worker (updates attrs/ep, preserves admin bits).
This commit is contained in:
parent
1599d06bc4
commit
93ed282ef7
3 changed files with 194 additions and 55 deletions
22
.kiro/specs/worker-join-refactor/spec.json
Normal file
22
.kiro/specs/worker-join-refactor/spec.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"feature_name": "worker-join-refactor",
|
||||
"created_at": "2026-05-15T00:00:00Z",
|
||||
"updated_at": "2026-05-15T03:20:00Z",
|
||||
"language": "en",
|
||||
"phase": "tasks-generated",
|
||||
"approvals": {
|
||||
"requirements": {
|
||||
"generated": true,
|
||||
"approved": true
|
||||
},
|
||||
"design": {
|
||||
"generated": true,
|
||||
"approved": true
|
||||
},
|
||||
"tasks": {
|
||||
"generated": true,
|
||||
"approved": true
|
||||
}
|
||||
},
|
||||
"ready_for_implementation": true
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue