#1033 Activity worker livelocks on an activity whose workflow_run row is missing
Description
EditFound during #906 (both former copies, now engine/services/activity_worker/claiming.py _claim_activities_batch). claim_next_activity marks the row running, then the tenant lookup JOINs workflow_run; when the run row is missing it raises ValueError inside the claim transaction, the whole batch rolls back and returns []. highway.activity_queue.workflow_run_id has no FK to workflow_run, and claim_next_activity orders pending rows by created_at, so the same orphan is claimed first on every poll and the worker never runs any other activity. Not reproduced live (static + schema read). Fix direction: mark the orphan failed (no event possible: no tenant) in the same transaction and continue the batch; or add the FK with ON DELETE CASCADE after checking existing orphans read-only. Red-first test on a scratch DB.
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...