Refactor: enahnce retry and timeout (#14983)

### What problem does this PR solve?

1. Enhance retry and timeout, and adjust the default timeout
2. NER: spacy do not batch chunks
3. extract _has_cancel_and_exit
4. enhance log messages

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Refactoring
This commit is contained in:
Wang Qi
2026-05-22 13:16:39 +08:00
committed by GitHub
parent 11ff848b04
commit a9ec78cb9c
8 changed files with 337 additions and 104 deletions

View File

@@ -363,6 +363,15 @@ class GraphragConfig(Base):
community: Annotated[bool, Field(default=False)]
resolution: Annotated[bool, Field(default=False)]
batch_chunk_token_size: Annotated[int, Field(default=4096, ge=512, le=8196)]
retry_attempts: Annotated[int, Field(default=2, ge=1, le=10)]
retry_backoff_seconds: Annotated[float, Field(default=2.0, ge=0.0, le=600.0)]
retry_backoff_max_seconds: Annotated[float, Field(default=60.0, ge=0.0, le=3600.0)]
build_subgraph_timeout_per_chunk_seconds: Annotated[int, Field(default=300, ge=1, le=86400)]
build_subgraph_min_timeout_seconds: Annotated[int, Field(default=600, ge=1, le=86400)]
merge_timeout_seconds: Annotated[int, Field(default=180, ge=0, le=86400)]
resolution_timeout_seconds: Annotated[int, Field(default=1800, ge=0, le=86400)]
community_timeout_seconds: Annotated[int, Field(default=1800, ge=0, le=86400)]
lock_acquire_timeout_seconds: Annotated[int, Field(default=600, ge=0, le=86400)]
class ParentChildConfig(Base):