Skip to content

Keep ALTS Flower state across restarts and purge offline workers - #46

Merged
anfimovdm merged 1 commit into
masterfrom
al-alts-flower-persistent
Oct 27, 2026
Merged

anfimovdm merged 1 commit into
masterfrom
al-alts-flower-persistent

Conversation

@anfimovdm

Copy link
Copy Markdown
Contributor

Summary

ALTS Flower keeps its task and worker history in memory only. Every restart, including the one on each ALTS update, empties the dashboard, and workers that go away stay listed until the next restart.

Changes

  • roles/alts_flower/defaults/main.yml: new defaults
    • flower_purge_offline_workers: 1800: drop workers offline for 30 minutes.
    • flower_persistent: true, flower_db: /home/<test_system_user>/flower_db, flower_state_save_interval: 60000: keep state across restarts, saved every minute (with 0 it's saved only on a clean shutdown).
  • roles/alts_flower/templates/alts-flower.service.j2: passes them to celery flower. The persistence options are skipped with flower_persistent: false.

The unit file changes, so the next run of the role restarts Flower once.

Testing

  • Rendered the unit with Ansible's trim_blocks for flower_persistent true and false: the ExecStart continuation lines stay intact in both.
  • Checked that persistent, db, state_save_interval and purge_offline_workers are options of the pinned flower==2.0.1.
  • Not yet deployed.

Flower kept its task and worker history in memory only, so every restart (including each ALTS update) emptied the dashboard, while workers that went away stayed listed forever. Run it in persistent mode, saving state to ~/flower_db every minute, and drop workers that have been offline for 30 minutes. All values are role defaults and persistence can be turned off with flower_persistent: false.
@anfimovdm anfimovdm self-assigned this Oct 27, 2026
@anfimovdm
anfimovdm merged commit c0886fb into master Oct 27, 2026
1 check failed
@anfimovdm
anfimovdm deleted the al-alts-flower-persistent branch October 27, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant