09d4613e46
366 台批量执行 results JSON 超 TEXT 64KB 导致 flush 失败、状态卡在 running。 Co-authored-by: Cursor <cursoragent@cursor.com>
931 B
931 B
2026-06-08 — 脚本执行 results 落库 TEXT 溢出修复
摘要
script_executions.results扩为MEDIUMTEXT- Redis → MySQL flush 前截断每台 stdout/stderr(512 字符),超大批次降级为摘要
动机
366 台脚本执行结果 JSON 约 75KB,超过 MySQL TEXT(64KB),flush 失败导致状态卡在 running、无 completed_at。
涉及文件
server/infrastructure/redis/script_execution_store.pyserver/domain/models/__init__.pyserver/infrastructure/database/migrations.pytests/test_script_execution_mysql_persist.py
迁移/重启
- 启动时
run_schema_migrations()自动MODIFY results MEDIUMTEXT - 需重启 API 容器使新 flush 逻辑生效
验证
pytest tests/test_script_execution_mysql_persist.py -q
bash deploy/pre_deploy_check.sh
部署后:执行记录 #14 应在 60s 内 flush 为 partial 并写入 completed_at。