[Question]: Questions about Redis
Self Checks
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (Language Policy).
- [x] Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
- [x] Please do not modify this template :) and fill in all the required fields.
Describe your problem
When using the service, by parsing PDF or DOC documents through RagFlow, it was found that in addition to the main keys, there were also a large number of temporary keys in Redis. Some of these temporary keys were empty, some were specific values, and some were strings with unknown meanings. When I stopped the service, these temporary keys still existed. As I use document parsing multiple times, these temporary keys become increasingly common. I am not sure if these temporary keys are intentionally designed by the system or the result of the system's failure to delete them properly. Could you please help me clarify
Hello @setty1007! 👋 I'm Dosu, a bot here to help you with bugs, questions, and anything else you might need while you wait for a human maintainer. Let's tackle those Redis temporary keys together!
RagFlow does have a mechanism for cleaning up temporary keys in Redis after their use. Specifically, the report_status function is responsible for removing expired entries in the Redis sorted set associated with a consumer. This is done using the REDIS_CONN.zpopmin(CONSUMER_NAME, expired) method. Additionally, if a consumer is determined to be expired (i.e., it has no recent activity), it is removed from the TASKEXE set, and its associated Redis key is deleted using REDIS_CONN.delete(consumer_name) [1].
If you are noticing that temporary keys persist even after stopping the service, it might be worth checking if the cleanup mechanism is being triggered correctly or if there are any conditions preventing the deletion of these keys.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
Indeed, I have seen the report_status method handling Redis temporary keys in text_executor.exe. py, but during the process of parsing the document, I found that report_status did not perform the deletion work well, and there were still some temporary keys that were not deleted. I hope it can be optimized in the future,