Repository navigation
Keep ALTS Flower state across restarts and purge offline workers - #46
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 defaultsflower_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 (with0it's saved only on a clean shutdown).roles/alts_flower/templates/alts-flower.service.j2: passes them tocelery flower. The persistence options are skipped withflower_persistent: false.The unit file changes, so the next run of the role restarts Flower once.
Testing
trim_blocksforflower_persistenttrue and false: theExecStartcontinuation lines stay intact in both.persistent,db,state_save_intervalandpurge_offline_workersare options of the pinnedflower==2.0.1.