MemoryCacheTest's "ooms the mem-cache" should not lose its idle mapping under full-suite load

未关闭
#6,446 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
kotlin
领域
databases, testing

调研方向

Start with MemoryCacheTest.kt:211 and the MemoryCache fetch loop and evictIdleFiles behavior described in the issue. Reproduce under the full ./gradlew test suite, then compare dispatcher-controlled ordering with the cache’s idle reuse behavior. Done when the test is reliable under full-suite load and the cause is addressed.

由索引模型根据 Issue 内容生成。

描述

flaky

MemoryCacheTest's ooms the mem-cache should pass under full-suite load; it intermittently finds the idle mapping it expects to reuse already gone.

  • Seen once in a full ./gradlew test on a branch that doesn't touch xtdb.cache (#6440), at MemoryCacheTest.kt:211:
    AssertionFailedError: the second get's mapping, still idle ==> expected: <2> but was: <3>
  • Passes in isolation — 8 of 8 runs of :xtdb-core:test --tests 'xtdb.cache.MemoryCacheTest' on the same tree.

Analysis

  • The test's PathLoader stamps each load with a counter, so 3 means the third get re-loaded the file rather than reusing the 50-byte slice's mapping.
  • assumption: the second get's mapping is evicted, or not yet idle, by the time the third get runs — MemoryCache runs its fetch loop and evictIdleFiles on Dispatchers.IO, while the test runs under runTest, so the order of the release, the eviction pass and the next get depends on thread timing. Not confirmed.

Open questions

  • Q1: should the test inject a single-threaded dispatcher (MemoryCache takes one; it yields when it isn't Dispatchers.IO), or is the cache's idle-reuse guarantee itself racy?
主要语言
Clojure
星标
3.1k
派生
193
平均合并
1 天 8 小时
30 天内合并 PR
73

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

xtdb/xtdb 的其他 Issue

查看 xtdb/xtdb 的全部 Issue

相似的 Issue

更多 Clojure Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。