This commit is contained in:
2026-09-03 10:01:42 +08:00
parent 71d042906c
commit 7bfafc7be3
18 changed files with 671 additions and 228 deletions
+8 -5
View File
@@ -115,11 +115,14 @@ func (s *trainingService) pollOne(ctx context.Context, runner common.TrainingRun
}
if !alive {
// 竞态防护:脚本原子写结果文件后进程随即退出,轮询可能命中「结果未就绪 + 进程已死」窗口;
// 判死前延迟重试一次,确认文件确实缺席(结果文件迟到属正常时序,非训练失败)
time.Sleep(2 * time.Second)
if r2, e2 := runner.FetchResult(ctx, job); e2 == nil && r2 != "" {
s.handleResult(ctx, runner, job, t, r2, tail)
return
// 判死前多次延迟重试,确认文件确实缺席(实测结果文件可比进程退出迟到数秒,
// 单次 2s 重试不够稳;2026-09-03 训练 37/38 曾因文件迟到被误判失败)
for i := 0; i < 5; i++ {
time.Sleep(5 * time.Second)
if r2, e2 := runner.FetchResult(ctx, job); e2 == nil && r2 != "" {
s.handleResult(ctx, runner, job, t, r2, tail)
return
}
}
_ = s.finishFailed(ctx, t, "训练进程已退出(无结果文件)")
return
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.