Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix strand hanging when strand count exceeds BALLERINA_SQL_MAX_POOL_SIZE #735

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

MohamedSabthar
Copy link
Member

@MohamedSabthar MohamedSabthar commented Oct 9, 2024

Purpose

Fixes: ballerina-platform/ballerina-library#7244

The SynchronousQueue does not buffer tasks and only acts as a hand-off point. This causes the ThreadPoolExecutor to fail with a RejectedExecutionException, leading to unexecuted tasks and causing the Ballerina future to remain incomplete. As a result, the Ballerina strand hangs indefinitely.

Changing the SynchronousQueue to a LinkedBlockingQueue allows for task buffering, which eliminates the RejectedExecutionException and improves task execution.

Examples

Checklist

  • Linked to an issue
  • Updated the specification
  • Updated the changelog
  • Added tests
  • Checked native-image compatibility

Copy link

sonarqubecloud bot commented Oct 9, 2024

@MohamedSabthar MohamedSabthar changed the title Fix hanging issue when strand count exceeds BALLERINA_SQL_MAX_POOL_SIZE Fix strand hanging when strand count exceeds BALLERINA_SQL_MAX_POOL_SIZE Oct 9, 2024
@MohamedSabthar MohamedSabthar marked this pull request as ready for review October 9, 2024 11:22
@ayeshLK
Copy link
Member

ayeshLK commented Oct 9, 2024

@MohamedSabthar I feel it would be better if we could add a description to the PR providing the proper reason for this issue and how this suggestion would fix this issue. WDYT ?

@MohamedSabthar MohamedSabthar merged commit 99a0d7a into ballerina-platform:master Oct 9, 2024
6 checks passed
@MohamedSabthar MohamedSabthar mentioned this pull request Oct 9, 2024
5 tasks
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.

Redshift connector hanging when strand count exceeds BALLERINA_SQL_MAX_POOL_SIZE
3 participants