debug(M7.2c): judge fetch 加防御日志定位 PENDING 期间 500

这个提交包含在:
langxm
2026-10-14 10:31:11 +08:00
父节点 f00a68f547
当前提交 f018297ad9
+9
查看文件
@@ -64,6 +64,15 @@ async def fetch(rid: str, uid: str = "guest", session: Session = Depends(get_ses
data = await svc.fetch(rid)
except JudgeEngineError as e:
raise HTTPException(404, str(e))
except Exception as e:
import logging, traceback
logging.getLogger("fluent.judge").exception("judge fetch 未预期异常")
try:
with open("/tmp/fl_judge_err.log", "a") as f:
f.write(f"[{rid}] {type(e).__name__}: {e}\n{traceback.format_exc()}\n---\n")
except Exception:
pass
raise HTTPException(500, f"judge fetch 内部错误: {type(e).__name__}: {e}")
# 判题结果回写消息 meta
msg = MessageRepo(session).find_by_meta("rid", rid)
if msg: