Skip to content

Shut down KV space compaction executors - #293

Open
efegokdemir wants to merge 1 commit into
apache:mainfrom
efegokdemir:codex/issue-290-compaction-shutdown
Open

efegokdemir wants to merge 1 commit into
apache:mainfrom
efegokdemir:codex/issue-290-compaction-shutdown

Conversation

@efegokdemir

Copy link
Copy Markdown
Contributor

Summary

  • Shut down per-space RocksDB compaction executors when a KV space closes or is destroyed.
  • Remove the associated executor metrics and add regression coverage.

Testing

  • ./mvnw -pl testsuites -am -DskipTests install — passed with Java 21.
  • ./mvnw -pl base-kv/base-kv-local-engine-rocksdb -am -Dtest=RocksDBCPableKVEngineTest -DfailIfNoTests=false test — passed with Java 21 (19 tests).
  • git diff --check — passed.

Fixes #290

Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
@ImDanXie

Copy link
Copy Markdown
Contributor

Fix verified independently against the compiled classes during the investigation behind #290 — after close() the surviving non-daemon thread was uniquely the compactor, and the probe process refused to exit until killed; with the executor shut down the process exits cleanly. The thread-leak half of #290 is fully addressed.

One scope note for the record (does not block this PR): ExecutorServiceMetrics.monitor registers nine meters per KV space (kvspace.executor, .active, .queued, .pool.size, .pool.core, .pool.max, .completed, .idle, .queue.remaining), and those were also never removed — see the Metric registration section of #290. This PR captures the meter ids at construction via a global-registry scan, which grabs them correctly today; a future micrometer version exposing a proper handle for the monitor would make this cleaner. The thread leak (the OOM driver) is the part that matters and is fixed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Per-KV-space RocksDB compaction executor is never shut down: non-daemon threads accumulate and prevent JVM exit

2 participants