Lev Zemlyanov
10/01/2025, 10:12 PMLev Zemlyanov
10/01/2025, 11:02 PM/get_scheduled_flow_runs
(we can make a new endpoint i.e /get_assigned_scheduled_flow_runs
) which gives ownership to the worker and reassigns any flows given to a dead worker (identified by the heartbeat)
UPDATE flow_run
SET worker_id = 'xxx'
WHERE id IN (SELECT id FROM flow_run LEFT JOIN worker_heartbeat on worker_id = worker_heartbeat.worker_id WHERE flow_run.status = 'scheduled' or (flow_run.status = 'pending' and worker_is_alive = false ) LIMIT 100);
This has the added benefit of letting workers horizontally scale without stepping on each other's toes - something we are having trouble with in K8S.alex
10/02/2025, 1:57 PMLev Zemlyanov
10/02/2025, 9:33 PMWorker 'KubernetesWorker 0effa744-0226-4eb0-b718-8f016beac43f' submitting flow run 'b21c392d-3f0a-4ede-b6d3-1756ffc54716'
Worker 'KubernetesWorker 6de4ecc3-90d7-45ef-9ca5-8df8bd924c1e' submitting flow run 'b21c392d-3f0a-4ede-b6d3-1756ffc54716'
Aborted submission of flow run 'b21c392d-3f0a-4ede-b6d3-1756ffc54716'. Server sent an abort signal: This run is in a PENDING state and cannot transition to a PENDING state.
Creating Kubernetes job...