fix(货源): 主图转存对瞬时 TLS 重置做有界重试,失败行日志带上真实原因

生产取证:主机A 近 3 小时 252 条 `main download fail` 全是 m.media-amazon.com 的
"Remote host terminated the handshake",而这些 URL 事后重取 8 条里 7 条直接 200。
旧实现单发、握手被 RST 就 return null 并丢掉真实异常,导致整行白占一轮重发。

新增 aiimage.similar-asin.llm-image-download-retry-times(默认额外 2 次,置 0 退回旧行为),
只重试连接级异常,非 200 不重试;25 秒总预算防慢源放大尾延迟;重试耗尽抛 IOException
让行失败原因上行到日志。
This commit is contained in:
2026-09-28 11:52:11 +08:00
parent 9efb39b0a5
commit 3a39c36bde
5 changed files with 439 additions and 21 deletions
@@ -186,4 +186,13 @@ public class SimilarAsinProperties {
/** 拼接图/主图下载超时(秒),慢源图片较多时放大该值。 */
private int llmImageDownloadTimeoutSeconds = 10;
/**
* 主图转存的<b>额外</b>重试次数(0=不重试,与原行为一致)。
* 依据 2026-09-28 生产取证:主机A 近 3 小时 252 条主图下载失败全部是
* {@code m.media-amazon.com} 的 "Remote host terminated the handshake",
* 而这些 URL 事后 curl 8 条里 7 条直接 200 —— 瞬时抖动,重试就能救回整行
* (不重试则整行判失败并重发一轮流程)。设 0 可退回旧行为。
*/
private int llmImageDownloadRetryTimes = 2;
}