You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "anusha975 (via GitHub)" <gi...@apache.org> on 2026/03/07 12:49:31 UTC
[PR] Improve SessionPoolExample by replacing unbounded fixed thread pool w… [iotdb]
anusha975 opened a new pull request, #17269:
URL: https://github.com/apache/iotdb/pull/17269
This PR improves the SessionPoolExample by replacing the use of Executors.newFixedThreadPool() with a ThreadPoolExecutor backed by a bounded queue.
Motivation:
Executors.newFixedThreadPool internally uses an unbounded LinkedBlockingQueue, which may allow unlimited task accumulation and potentially lead to OutOfMemoryError in high-throughput scenarios.
Since this is an official example, using a bounded queue demonstrates safer best practices for users.
Changes:
* Replace Executors.newFixedThreadPool with ThreadPoolExecutor
* Use ArrayBlockingQueue with bounded capacity
* Add explanatory comment
This change only affects example code and does not modify core IoTDB functionality.
--
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