fix(任务兜底拉取): 认领转交 owner_instance_id 且归属校验改读列 —— 认领在 server-121 而任务 parse 落 server-110 时, 组装载荷被归属校验拒绝并误标失败; resultJson 里的 ownerInstanceId 只是 parse 快照, 转交后不同步

This commit is contained in:
2026-09-30 12:14:54 +08:00
parent 829dbf1a72
commit 27a7cd0f82
2 changed files with 14 additions and 2 deletions
@@ -2005,7 +2005,16 @@ public class AppearancePatentTaskService {
}
private String ownerFromTask(FileTaskEntity task) {
if (task == null || task.getResultJson() == null || task.getResultJson().isBlank()) {
if (task == null) {
return null;
}
// 优先读 owner_instance_id 列:兜底拉取认领(TaskClientPullService.claim)会转交该列,
// 而 resultJson 里的 ownerInstanceId 只是 parse 时的快照,转交后不同步 ——
// 只读快照会把已在别处认领的任务误拒并标失败(2026-09-30 内部认领上线实测)。
if (task.getOwnerInstanceId() != null && !task.getOwnerInstanceId().isBlank()) {
return task.getOwnerInstanceId();
}
if (task.getResultJson() == null || task.getResultJson().isBlank()) {
return null;
}
try {