mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-07-15 21:11:05 +02:00
- index/utils.py: fix an asyncio deadlock in _sync_llm_semaphore. Sync LLM calls (check_toc / process_no_toc / toc_transformer) run on the event-loop thread nested inside the async meta_processor, and its blocking ceiling acquire could wait forever for a permit held by async _llm_semaphore holders that can only release it once the (now-frozen) loop runs. Take the slot non-blocking when on a running loop; keep the blocking acquire off-loop. - index/utils.py: bound parse_pages ranges before materializing range() into the list, so a huge span like '1-2000000000' is rejected up front instead of exhausting memory before the 1000-page cap is ever checked (DoS). - storage/sqlite.py: bump a generation counter on close() so a thread that cached a connection in thread-local storage reconnects on its next call instead of reusing a closed handle (ProgrammingError). - backend/cloud.py: after connect, bail out of the SSE background thread if the consumer already abandoned the stream, instead of draining it in the background. Adds regression tests for each fix. |
||
|---|---|---|
| .. | ||
| backend | ||
| index | ||
| parser | ||
| storage | ||
| __init__.py | ||
| agent.py | ||
| client.py | ||
| cloud_api.py | ||
| collection.py | ||
| config.py | ||
| errors.py | ||
| events.py | ||
| page_index.py | ||
| page_index_md.py | ||
| retrieve.py | ||
| tokens.py | ||
| types.py | ||
| utils.py | ||