fix(startup): 两个 GroupDeletionGuard 显式命名 + Bean 名唯一性守卫测试
事故:2026-09-14 边界收敛新增 invalidasin/dedupe 两个同名 GroupDeletionGuard,
Spring 默认用简单类名做 Bean 名 → 启动抛 ConflictingBeanDefinitionException,
主机 A 的 java-server 连续重启失败(health 不通),**单测全绿也发现不了**
(不起完整 Spring 上下文),部署后才知道。
- 两个守卫分别显式命名 @Service("invalidAsinGroupDeletionGuard") / ("dedupeGroupDeletionGuard")
- 新增 SpringComponentBeanNameUniquenessTest:扫描 main 源码,同简单名的组件必须显式命名,
否则红测试(把这次事故固化成可回归的守卫)
- 已重新打包部署:JAR 1f1e82bda227f2b0768574f8fd7c32c9,双节点 health=200
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* 分组删除守卫:去重总数据(2026-09 从 shopkey 收回本模块,文案保持不变)。
|
||||
*/
|
||||
@Service
|
||||
@Service("dedupeGroupDeletionGuard")
|
||||
@RequiredArgsConstructor
|
||||
public class GroupDeletionGuard implements GroupDeletionGuardPort {
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* 分组删除守卫:品牌数据库(不符合 ASIN)数据(2026-09 从 shopkey 收回本模块,文案保持不变)。
|
||||
*/
|
||||
@Service
|
||||
@Service("invalidAsinGroupDeletionGuard")
|
||||
@RequiredArgsConstructor
|
||||
public class GroupDeletionGuard implements GroupDeletionGuardPort {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user