Closed gabilang closed 2 weeks ago
The same issue observed when using CompletableFuture and Semaphore as well.
All strand executor threads are on waiting state:
This is correct behaviour. Strand thread pool default have number of cores * 2. So if you have 4 core machine it will have 8 threads. If you block the strand thread then after 8 invocations server will be hang.
We should not block the strand thread using countdown latch or any other concurrency mechanism. We need to use markasync and future.complete methods to block the strand without blocking underlying thread.
Refer [1] for more info.
Description
$title
Steps to Reproduce
Ballerina code:
Java interop method:
Strand Dump:
Thread dump:
Affected Version(s)
No response
OS, DB, other environment details and versions
No response
Related area
-> Runtime
Related issue(s) (optional)
https://github.com/ballerina-platform/ballerina-library/issues/6474
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response