Skip to content

Conversation

@QiuYucheng2003
Copy link

Description

This PR fixes issue #17016.

As discussed in the issue, the SessionPoolExample currently uses Executors.newFixedThreadPool(10), which internally employs an unbounded LinkedBlockingQueue. This can lead to OutOfMemoryError in high-throughput scenarios if users copy this example code into production.

This PR replaces it with a ThreadPoolExecutor using a bounded ArrayBlockingQueue to provide backpressure and ensure system stability.

Related Issue

Fixes #17016

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)

Checklist:

  • I have performed a self-review of my own code
  • My changes generate no new warnings

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, this is your first pull request in IoTDB project. Thanks for your contribution! IoTDB will be better because of you.

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.

[Improvement] Avoid potential OOM in SessionPoolExample by replacing unbounded thread pool

1 participant