fix(稳定性): 修任务锁超时/实例转发/扫描降噪,补 rustfs 结论日志
线上日志扫描发现的缺陷批量修复: - TaskFileJobService.resetStuckRunningJobsDetailed 去掉跨行长事务:两节点 @Scheduled 各取 200 行在同一事务里逐行 UPDATE,互等行锁导致 biz_task_file_job 每天上百次 Lock wait timeout。改逐行独立提交(本就有 CAS 条件,幂等) - TaskOwnerForwardService 连接类失败重试 3 次:两节点滚动重启窗口内的 Connection refused 会直接丢掉用户提交的结果(读超时不重放,避免重复提交) - AdminApiGuardFilter 把 401/被顶下线降为 debug(线上单节点一天近 3000 条噪声) - NoResourceFoundException 单独处理:如实返回 404,不再刷 ERROR 堆栈、不再伪装 200(每天 580 条,绝大多数是外部扫描 /.env、/credentials、aliyun.json 等) - RustfsObjectStorageService 补「重试后成功 / 重试耗尽」结论日志:一天上千条 retrying 却无结论,无法判断数据是否落盘 - 连接池 keep-alive 300s→30s,减少复用已被对端关闭的空闲连接 - SimilarAsin 提交结果遇到已删除任务时带 TASK_NOT_FOUND(40401),客户端据此 停止每 30 秒一轮的无谓重试 - 修 SimilarAsinResultRowDto 的 GBK 乱码 JsonAlias("浠锋牸" → "价格")
This commit is contained in:
+9
@@ -238,6 +238,12 @@ public class RustfsObjectStorageService {
|
||||
resetFailureWindow(operation);
|
||||
}
|
||||
recordOperation(operation, "success", elapsedNanos(startedAt));
|
||||
if (attempt > 1) {
|
||||
// 重试后成功必须留 INFO 结论:线上一天上千条 "operation failed, retrying"
|
||||
// 却没有任何结论日志,无法判断这些上传最后到底落盘了没有。
|
||||
log.info("[rustfs] 重试后成功 operation={} objectKey={} attempt={}/{} durationMs={} bytes={}",
|
||||
operation, objectKey, attempt, maxRetries, elapsedMillis(startedAt), bytes);
|
||||
}
|
||||
log.debug("[rustfs] operation success operation={} objectKey={} attempt={}/{} durationMs={} bytes={}",
|
||||
operation, objectKey, attempt, maxRetries, elapsedMillis(startedAt), bytes);
|
||||
return result;
|
||||
@@ -262,6 +268,9 @@ public class RustfsObjectStorageService {
|
||||
operation, objectKey, deadlineNanos);
|
||||
}
|
||||
}
|
||||
// 重试耗尽:留 ERROR 结论 + 最后一次错误,否则只看到一串 retrying,无从判断是否真丢数据
|
||||
log.error("[rustfs] 重试耗尽,最终失败 operation={} objectKey={} maxRetries={} 最后一次错误={}",
|
||||
operation, objectKey, maxRetries, last == null ? "无" : last.getMessage(), last);
|
||||
throw new IllegalStateException("failed to " + operation + " payload in transient storage", last);
|
||||
} finally {
|
||||
if (totalAcquired) {
|
||||
|
||||
Reference in New Issue
Block a user