You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "ShauryaChauhan1411 (via GitHub)" <gi...@apache.org> on 2026/03/11 17:22:56 UTC
[PR] [IOTDB-17268] Optimize ThreadPool in SessionPoolExample to prevent OOME [iotdb]
ShauryaChauhan1411 opened a new pull request, #17286:
URL: https://github.com/apache/iotdb/pull/17286
The current SessionPoolExample uses Executors.newFixedThreadPool(10), which internally relies on an unbounded LinkedBlockingQueue. In scenarios with high task submission rates, this unbounded queue can grow indefinitely, leading to OutOfMemoryError (OOME) and system instability.
Changes
Replaced the unbounded fixed thread pool with a custom ThreadPoolExecutor.
Implemented a bounded ArrayBlockingQueue with a capacity of 1000 to limit memory consumption.
Configured ThreadPoolExecutor.CallerRunsPolicy as the rejection handler. This ensures that if the queue is full, the submitting thread executes the task, providing a natural backpressure mechanism and preventing task loss or system crashes.
Test Result
Verified the build using mvn clean install -DskipTests -pl example/session.
Applied code formatting using mvn spotless:apply.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [IOTDB-17268] Optimize ThreadPool in SessionPoolExample to prevent OOME [iotdb]
Posted by "ShauryaChauhan1411 (via GitHub)" <gi...@apache.org>.
ShauryaChauhan1411 closed pull request #17286: [IOTDB-17268] Optimize ThreadPool in SessionPoolExample to prevent OOME
URL: https://github.com/apache/iotdb/pull/17286
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org