ambiguous-pointer commented on PR #1617:
URL: https://github.com/apache/dubbo-admin/pull/1617#issuecomment-6877909020

   关于持久化 deadline:已在 [Issue 
#1645](https://github.com/apache/dubbo-admin/issues/1645) 记录该问题,并已开 issue 跟踪。
   
   已核对这个 PR 的实现——`persistenceContext(ctx)` 返回 
`context.WithTimeout(context.WithoutCancel(ctx), persistenceTimeout)`,每次写入独立取有界 
context,这正是问题所在(原来的 `state.persistCtx` 是从交互开始计时的 30s 
lease,交互一超时就让工具结果、最终答案、轮次收尾三处写库同时失败)。**这部分本 PR 已经覆盖,不需要另起一个竞争性 PR。**
   
   还有两点本 PR 未覆盖,建议一并考虑,或在 #1645 里继续跟踪:
   
   1. **最终答案写库失败仍会中断整个交互。** 这里保留的是 `return fmt.Errorf("failed to persist final 
answer: %w", err)`。deadline 
修好后超时场景消失,但存储后端故障(连接池耗尽、慢查询、短暂不可用)依然会让**已经生成好的答案被整体隐藏**,用户收到失败而不是回答。答案已产出,存储不健康不应升级成产品故障——建议改为记录日志、不向上返回错误,轮次照常收尾。
   
   2. **缺「交互长于写预算」的回归用例。** `persistenceTimeout` 目前是 `const`,测试无法缩短它,无法构造这个场景。改成 
`var` 后可把预算调到极小、配合慢 store,断言长交互后工具结果与最终答案仍被写入、轮次正常收尾。改动很小,若倾向保持 `const`,则在 
#1645 里跟踪该项。
   
   顺带一个合并顺序的提示:#1596 → #1608 → #1609 → #1610 → #1611 → #1615 这条链上的 PR 
目前都还保留着交互级的 `persistCtx`(只新增了 `CompleteInteraction`),**#1617 
合并之前,整轮丢失的问题在这条链上依然存在**。若中间任何一个先合入 `ai`,deadline 问题会被带进分支。
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to