ragflow/rag
S0b3Rr 5d21cc3660
fix: Fix the problem that concurrent execution limit in task executor fails and causes OOM (issue#7580) (#7700)
### What problem does this PR solve?

## Cause of the bug:
During the execution process, due to improper use of trio
CapacityLimiter, the configuration parameter MAX_CONCURRENT_TASKS is
invalid, causing the executor to take out a large number of tasks from
the Redis queue at one time.

This behavior will cause the task executor to occupy too much memory and
be killed by the OS when a large number of tasks exist at the same time.
As a result, all executing tasks are suspended.

## Fix:
Added the task_manager method to the entry of /rag/svr/task_executor.py
to make CapacityLimiter effective. Deleted the invalid async with
statement.

## Fix result:
After testing, the task executor execution meets expectations, that is:
concurrent execution of up to $MAX_CONCURRENT_TASKS tasks.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
2025-05-19 10:25:56 +08:00
..
app Fix: docx get image exception. (#7636) 2025-05-14 12:24:48 +08:00
llm Feat: Support tool calling in Generate component (#7572) 2025-05-16 16:32:19 +08:00
nlp Feat: add image preview to retrieval test. (#7610) 2025-05-13 14:30:36 +08:00
res Format file format from Windows/dos to Unix (#1949) 2024-08-15 09:17:36 +08:00
svr fix: Fix the problem that concurrent execution limit in task executor fails and causes OOM (issue#7580) (#7700) 2025-05-19 10:25:56 +08:00
utils Fix: whole knowledge graph lost after removing any document in the knowledge base (#7151) 2025-04-30 09:43:17 +08:00
__init__.py Update comments (#4569) 2025-01-21 20:52:28 +08:00
benchmark.py Refactor embedding batch_size (#3825) 2024-12-03 16:22:39 +08:00
prompts.py Fix: docx get image exception. (#7636) 2025-05-14 12:24:48 +08:00
raptor.py <think> tag is missing. (#7256) 2025-04-24 11:44:10 +08:00
settings.py Feat: Adds OpenSearch2.19.1 as the vector_database support (#7140) 2025-04-24 16:03:31 +08:00