Repository navigation
Conversation
ResumeGradingService#analyzeResume 在失败时返回 0 分占位结果,导致 AnalyzeStreamConsumer 走 markCompleted 分支把 analyze_status 写成 COMPLETED:retryMessage 永不触发,ResumeAnalysisRecoveryScheduler 的 shouldSkip 也会跳过该任务,用户看到的却是一份虚假的 0 分报告。 改为让异常向上传播(StructuredOutputInvoker 内部已按配置重试,并在耗尽后 抛出携带 RESUME_ANALYSIS_FAILED 的 BusinessException),由 AbstractStreamConsumer 统一重试,重试耗尽后置为 FAILED 并写入失败原因。 同时删除冗余的内层 catch 与已不再使用的 createErrorResponse。 新增 ResumeGradingServiceTest 与 AnalyzeStreamConsumerTest 锁定该行为: 失败必须向上传播且不落库占位报告,成功后按 attemptId 落库。 Refs Snailclimb#63
Author
|
没问题,这就关掉。这个 bug 是你部署时实际踩到的,从定位到提交自己完整走一遍很合理,坑位不该占。测试直接拿去用,按你列的三个方向改就行。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
#63 报告:LLM 调用失败时(429 / 超时 / 网络抖动 / 模型名配错),
ResumeGradingService#analyzeResume会把异常吞掉并返回一份 0 分占位结果,AnalyzeStreamConsumer因此走markCompleted把analyze_status写成COMPLETED:retryMessage永不触发;ResumeAnalysisRecoveryScheduler#shouldSkip见到COMPLETED直接跳过;改动
采用 issue 里的方案 A:让异常向上传播,交给既有的重试 / 恢复链路处理。
analyzeResume去掉外层catch (Exception)与createErrorResponse,失败时直接抛出StructuredOutputInvoker已构造好的BusinessException(RESUME_ANALYSIS_FAILED);createErrorResponse已无调用方,一并删除(该文件 -66 行)。链路随之恢复:
AbstractStreamConsumer#processMessage捕获异常 →retryMessage重新入队(最多 3 次)→ 耗尽后markFailed写入FAILED与失败原因;恢复调度器也能重新扫描到该任务。analyzeResume目前只有AnalyzeStreamConsumer一个调用方,签名与返回类型未变,无外部行为影响。测试
ResumeGradingServiceTest(3 个):失败时抛出同一个BusinessException并保留原始错误码;非业务异常也不再被吞成占位结果。AnalyzeStreamConsumerTest(2 个):分析失败时processBusiness向上抛出且不落库占位报告;成功时按attemptId落库。ResumeGradingService还原成旧实现后,3 个ResumeGradingServiceTest全部失败;恢复修复后全绿。./gradlew :app:test --no-daemon:487 个用例,0 失败。说明
degraded标记,由消费者识别后触发重试,重试耗尽再落库降级结果),我可以改成那一版 —— B 需要让AnalyzePayload带上retryCount才能判断「最后一次才落库」,改动面稍大。Refs #63