Merge remote-tracking branch 'origin/master' into fix/309-embed-resilience

# Conflicts:
#	nextcloud_mcp_server/vector/processor.py
This commit is contained in:
Chris Coutinho
2026-06-11 10:46:57 +02:00
19 changed files with 837 additions and 48 deletions
+24 -10
View File
@@ -33,6 +33,7 @@ from nextcloud_mcp_server.observability.tracing import trace_operation
from nextcloud_mcp_server.search.pdf_highlighter import PDFHighlighter
from nextcloud_mcp_server.usage import UsageEventStore
from nextcloud_mcp_server.vector import payload_keys
from nextcloud_mcp_server.vector._errors import format_exception_group
from nextcloud_mcp_server.vector.document_chunker import (
DocumentChunker,
PageAwareChunker,
@@ -284,6 +285,11 @@ async def processor_task(
# Signal that the task has started and is ready
task_status.started()
# Initialised before the loop so the broad except handler below can't hit an
# unbound name if receive() itself raises a non-TimeoutError/EndOfStream
# exception on the very first iteration (mirrors multi_user_processor_task).
doc_task: DocumentTask | None = None
while not shutdown_event.is_set():
try:
# Get document with timeout (allows checking shutdown)
@@ -313,14 +319,22 @@ async def processor_task(
break
except Exception as e:
logger.error(
"Processor %s error processing %s_%s: %s",
worker_id,
doc_task.doc_type,
doc_task.doc_id,
e,
exc_info=True,
)
if doc_task is not None:
logger.error(
"Processor %s error processing %s_%s: %s",
worker_id,
doc_task.doc_type,
doc_task.doc_id,
format_exception_group(e),
exc_info=True,
)
else:
logger.error(
"Processor %s error: %s",
worker_id,
format_exception_group(e),
exc_info=True,
)
# Continue to next document (no task_done() needed with streams)
logger.info("Processor %s stopped", worker_id)
@@ -499,7 +513,7 @@ async def process_document(
max_retries,
doc_task.doc_type,
doc_task.doc_id,
e,
format_exception_group(e),
extra={
"doc_id": doc_task.doc_id,
"doc_type": doc_task.doc_type,
@@ -518,7 +532,7 @@ async def process_document(
doc_task.doc_id,
max_retries,
reason,
e,
format_exception_group(e),
extra={
"doc_id": doc_task.doc_id,
"doc_type": doc_task.doc_type,