Add: post-init eligibility re-check in Worker.register() - #1672
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthrough
ChangesCallable registration eligibility
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6e9de2a to
87116dd
Compare
- Call _eligible_target_need on every post-READY dynamic register path, same rule as init()-time _validate_eligible_targets - Raise ValueError (not RuntimeError): post-init is a direct user API call, not a startup context - L2 naturally exempt via _eligible_target_need's level < 3 guard - Eligibility fires before cid budget when both checks would fail - LOCAL_CHIP eligibility also considers _next_level_workers, not just device_ids, so L4+ workers with chip-capable L3 children are eligible - Remove P0.2-b2 xfail from test_post_init_chip_callable_on_chipless_l3_rejected - Update tests that relied on the gap to provide eligible dispatch targets
Summary
Worker.register()now re-validates callable eligibility against the frozen topology on every post-init dynamic register path — the same_eligible_target_needrule that_validate_eligible_targetsapplies at init. Previously, a post-initChipCallableon a chipless L3 silently returned an inert handle; it now raisesValueError._eligible_target_needbefore acquiring the operation leaseValueError(notRuntimeError): post-init is a direct user API call, not a startup context_eligible_target_need'slevel < 3guardxfail(strict=True)marker fromtest_post_init_chip_callable_on_chipless_l3_rejectedTesting
test_startup_readiness.py+test_host_worker.py)