commercetools / commercetools/commercetools-sync-java
Race Condition in LRU cache for references can lead to null references
- 主要语言
- Java
- 星标
- 40
- 派生
- 41
- PR 合并指标
- 30 天内没有已合并 PR
描述
**Describe the bug**
The referenceResolver does occasionally resolve references to `null`.
The problem is, that the code, when resolving does first check which elements are already in the cache. It then fetches the "not yet in the cache" items and puts them there. This operation drops LRU items. Code still thinks that all items are in the cache and retrieves the references from the cache unchecked. Leading to `null`.
The symptom can be observed in SUPPORT-33245
**To Reproduce**
Steps to reproduce the behavior:
1. Call `` method with params ``
2. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.
贡献指南
调研方向
No source file or test is named. Start by locating the referenceResolver cache lookup and population path, then reproduce the SUPPORT-33245 scenario with concurrent resolution and cache eviction. Done means reference resolution no longer returns null when LRU entries are dropped, with a regression test covering the race.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- backend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100