ChunkCache drops a dirty chunk if saving it during eviction fails
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- cloud, java
调研方向
Start with ChunkCache and the eviction listener wired through Caffeine's .executor(Runnable::run), plus the chunkSaver.save call that catches IOException and NonWritableChannelException. The issue suggests a side map drained by flush() or excluding dirty chunks from eviction, but the design choice is open. Done means a dirty chunk survives a failed save during eviction and is written or reported by force(), which needs fault-injected tests since reproduction is unclear.
由索引模型根据 Issue 内容生成。
描述
I was reading ChunkCache while working on #370 and noticed this:
try {
chunkSaver.save(index, chunk);
} catch (IOException | NonWritableChannelException e) {
exceptionsDuringWrite.add(e);
}
bufferPool.recycle(chunk.data());
By the time this runs the chunk is already out of the cache, so if the save fails there is nothing left to retry. The exception is recorded and surfaces later in force(), but the data is gone, and the write() that produced it had already returned, so from the caller's side it looks written.
The cache holds at most five idle chunks (MAX_CACHED_CLEARTEXT_CHUNKS), so writing a file with more chunks evicts dirty ones as a matter of course. A transient ENOSPC or EIO at the wrong moment is enough.
I have not tried to reproduce it. It needs the save to fail exactly during eviction, so I guess it takes fault injection rather than a real filesystem.
It also does not look like a one-liner: the listener runs inside Caffeine's eviction (.executor(Runnable::run)), so re-inserting from there would just evict again. Keeping failed chunks in a side map drained by flush(), or keeping dirty chunks out of eviction altogether, both seem plausible.
Happy to take this if you think it is worth fixing.
- 主要语言
- Java
- 星标
- 110
- 派生
- 39
- 平均合并
- 1 天 28 分钟
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cryptomator/cryptofs 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 25/100
cryptomator/cryptofs#246 · 6 条评论 ·
-
难度 3/5 1-2 天 新手友好度 45/100
cryptomator/cryptofs#177 ·
-
难度 4/5 3-5 天 新手友好度 25/100
cryptomator/cryptofs#171 ·
-
难度 3/5 1-2 天 新手友好度 35/100
cryptomator/cryptofs#153 ·
-
难度 5/5 一周以上 新手友好度 25/100
cryptomator/cryptofs#151 ·
查看 cryptomator/cryptofs 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
wultra/powerauth-tests#980 ·
-
account bug communication lecture
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
line/centraldogma#1397 ·
维护者通常 2 天内回复
-
[Bug]: Fixed/recurring deposit accounts are treated as savings in ownership and listings可能已有人在做 @Aana123 今天认领。 未关闭bug Triage
难度 2/5 1-3 小时 新手友好度 76/100
apache/fineract-consumer-facing#252 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
cryptomator/hub#515 ·