mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-24 06:24:18 +02:00
Add verbose Redis error logging with full traceback
When Redis operations fail, log the full traceback to help diagnose ACL and permission issues in production environments. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
6e8c60b65e
commit
726976a99f
1 changed files with 17 additions and 3 deletions
|
|
@ -101,9 +101,23 @@ async def handle_tool_as_task(
|
|||
ttl_seconds = int(
|
||||
docket.execution_ttl.total_seconds() + TASK_MAPPING_TTL_BUFFER_SECONDS
|
||||
)
|
||||
async with docket.redis() as redis:
|
||||
await redis.set(task_meta_key, task_key, ex=ttl_seconds)
|
||||
await redis.set(created_at_key, created_at, ex=ttl_seconds)
|
||||
_logger.info(
|
||||
f"[{instance_id}] About to write to Redis: task_meta_key={task_meta_key}, "
|
||||
f"created_at_key={created_at_key}, ttl={ttl_seconds}"
|
||||
)
|
||||
try:
|
||||
async with docket.redis() as redis:
|
||||
await redis.set(task_meta_key, task_key, ex=ttl_seconds)
|
||||
await redis.set(created_at_key, created_at, ex=ttl_seconds)
|
||||
_logger.info(f"[{instance_id}] Redis write successful")
|
||||
except Exception as e:
|
||||
import traceback
|
||||
|
||||
_logger.error(
|
||||
f"[{instance_id}] Redis write FAILED: {type(e).__name__}: {e}\n"
|
||||
f"Traceback:\n{traceback.format_exc()}"
|
||||
)
|
||||
raise
|
||||
|
||||
# Send notifications/tasks/created per SEP-1686 (mandatory)
|
||||
# Send BEFORE queuing to avoid race where task completes before notification
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue