Closed MohamedSabthar closed 1 month ago
This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.
- Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
- Reason/Regression - The issue has introduced a regression.
- Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
- Reason/Complex - Issue occurred due to complex scenario.
- Reason/Invalid - Issue is invalid.
- Reason/Other - None of the above cases.
Description: Consider the below code
I observed that the threads are getting blocked if the strand count exceeds 50, as is evident from the strand dump.
This is probably due to Redshift internally using a
ThreadPoolExecutor
of sql module, which is configured with a default pool size of 50. Therefore, whenever a strand is spawned on the Ballerina side, a thread from the thread pool is utilized to serve that particular strand.However, scheduling more strands than the number of available threads results in a hang issue. Changing the pool size to a higher value via the environment variable
BALLERINA_SQL_MAX_POOL_SIZE
could temporarily solve the issue.However, ideally, the strand should not get blocked when the pool size is exhausted. It should wait until a thread in the pool becomes available to serve the request. This should be handled on the sql module side.
Related issue: https://github.com/wso2-enterprise/internal-support-ballerina/issues/774
Affected Versions:
OS, DB, other environment details and versions:
Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):