Skip to content

[Good First Issue] Migrate to Monitored Thread Pools by Replacing Native ExecutorService #2359

@Chillax-0v0

Description

@Chillax-0v0

Problem Description

Java's native Executors.new*ThreadPool() methods lack visibility into thread pool workloads. Missing queue size monitoring makes it hard to:

  • Detect thread pool congestion (e.g., blocking I/O tasks)
  • Diagnose "silent hangs" during incidents
  • Optimize pool sizing

Our utility class com.automq.stream.utils.Threads provides monitored alternatives (e.g., newFixedThreadPoolWithMonitor) that log queue sizes to s3stream-threads.log. However, AutoMQ code still contains unsafe native pool initializations.

Required Changes

  1. Replace all native pool creations (Executors.newFixedThreadPool, newCachedThreadPool, etc.) in AutoMQ code with matching Threads methods
  2. Extend Threads class if needed:
    • Add overloaded methods for parameter variations (e.g., custom thread factories)
    • Keep method signatures compatible with native Executors patterns
  3. Ensure no changes are made to original Apache Kafka code paths

Scope Guidance

Focus on code in these patterns:

  • Located in com.automq.* packages
  • Clearly identified as AutoMQ-specific additions (search for "AutoMQ inject" and "AutoMQ for Kafka inject")
  • Files with the AutoMQ HK Limited header

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions