-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add support for storing state in Redis #1397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
cc: @mher |
|
This is a great idea. Makes it much easier to run flower in a containerized environment. What needs to be done here to merge this in, @mher? |
the other big benefit here is state is not lost when the container restarts (if you don't have a persistent volume attached to your container). Created a PR for rediss support here |
|
@Nusnus Bump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Redis support as an alternative backend for storing Flower's persistent state, replacing the existing file-based storage mechanism. This enhancement enables running multiple instances of Flower concurrently by centralizing state management in Redis.
Key changes:
- Added Redis client initialization and state management logic
- Implemented Redis-based state loading and saving with pickle serialization
- Updated documentation to reflect Redis backend support
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| flower/events.py | Added Redis client initialization, state loading/saving logic with pickle serialization |
| docs/config.rst | Updated documentation to mention Redis backend support |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
auvipy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will also need unit tests to verify the proposed changes
|
Saving the entire state with a single |
@mher Agreed, but Flower isn't scalable as it is, due to a file based state. I don't think having this Redis alternative makes it any worse. The flower database gets corrupted more frequently than one would hope. Fixing it in Redis is much easier, and it also means the Flower container doesn't need to be restarted. Do you have any other plans or thoughts on moving the state out of filesystem to make it truly scalable? I do think that this implementation is a start in that direction. Please share any suggestions you might have to improve the current implementation. |
This pull request introduces support for storing the persistent state of Flower in Redis, as an alternative to the existing file-based storage mechanism. This enhancement aims to improve the reliability, scalability, and performance of state management in Flower.
This removes the limitation that prevented running multiple instances of Flower concurrently by centralizing state management in Redis.