Skip to content

fix: bound jetcd callback thread pool in etcd driver - #32

Merged
merlimat merged 2 commits into
mainfrom
fix-etcd-jetcd-thread-pool
Jul 9, 2026
Merged

fix: bound jetcd callback thread pool in etcd driver#32
merlimat merged 2 commits into
mainfrom
fix-etcd-jetcd-thread-pool

Conversation

@merlimat

@merlimat merlimat commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Problem

Under a max-throughput run (thousands of in-flight requests) the etcd driver's worker OOMs. jetcd defaults to an unbounded cached thread pool for its async callbacks, which grows to ~9k threads under high concurrency and exhausts the worker's native memory (pthread EAGAIN).

Fix

Pin jetcd's callback executor to a bounded pool (Executors.newFixedThreadPool(64)) via Client.builder().executorService(...), and shut it down in close(). executorService() is part of jetcd's stable core builder API (unlike connectTimeout), so it's safe against the shaded-jetcd ambiguity already noted in this file.

Verification

etcd completed the full YCSB throughput comparison on a real cluster with 0 failures and no OOM (previously OOMKilled mid-run).

merlimat added 2 commits July 8, 2026 17:16
jetcd defaults to an unbounded cached thread pool for its async callbacks.
Under a max-throughput run (thousands of in-flight requests) that grows to
thousands of threads and OOMs the worker (native pthread EAGAIN). Pin it to a
bounded fixed pool via Client.builder().executorService(), and shut it down in
close(). executorService() is part of jetcd's stable core builder API, so it is
safe against the shaded-jetcd ambiguity already noted in this file.

Signed-off-by: Matteo Merli <mmerli@apache.org>
Signed-off-by: Matteo Merli <mmerli@apache.org>

# Conflicts:
#	src/main/java/io/oxia/benchmark/driver/etcd/EtcdDriver.java
@merlimat
merlimat merged commit 3dcddbe into main Jul 9, 2026
2 checks passed
@merlimat
merlimat deleted the fix-etcd-jetcd-thread-pool branch July 9, 2026 00:33
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.

1 participant