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

[Bug]: Multiple async calls of interop functions hangs when the Java method has synchronous waiting #42604

Closed
gabilang opened this issue Apr 22, 2024 · 4 comments
Assignees
Labels
Reason/Invalid Issue is invalid. Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug

Comments

@gabilang
Copy link
Contributor

gabilang commented Apr 22, 2024

Description

$title

Steps to Reproduce

Ballerina code:

import ballerina/io;
import ballerina/jballerina.java;

public function main() returns error? {
    future<error?> futureResult;
    foreach int i in 0...25 {
        futureResult = start test(i);
        // check test(i);
    }
    _ = check wait futureResult;
}

public class ABC {

    public int port;

    public isolated function init(int port) {
        self.port = port;
    }

    public isolated function getPort() returns int {
        return self.port;
    }
}

function test(int i) returns error? {
    io:println("Request started for ", i);
    ABC abc = new ABC(9090);
    io:println(getResource(abc));
    io:println("Request completed for ", i);
}

isolated function getResource(ABC abc) returns anydata = @java:Method {
    'class: "myapp.app.App"
} external;

Java interop method:

public static Object getResource(Environment env, BObject client) {

        final Object[] out = new Object[1];
        CountDownLatch countDownLatch = new CountDownLatch(1);

        Callback callback = new Callback() {
            @Override
            public void notifySuccess(Object o) {
                out[0] = o;
                countDownLatch.countDown();
            }

            @Override
            public void notifyFailure(BError bError) {
                out[0] = bError;
                countDownLatch.countDown();
            }
        };

        env.getRuntime().invokeMethodAsyncSequentially(client, "getPort", null,null, callback, null, PredefinedTypes.TYPE_INT);

        try {
            countDownLatch.await();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return out[0];
    }
Strand Dump:
Ballerina Strand Dump [2024/04/19 16:18:41]
===========================================

Total strand group count : 29
Total strand count : 51
Active strand group count : 28
Active strand count : 51

group 2 [RUNNABLE]: [24]
strand 28 "interop-async-seq" [N/A] [RUNNABLE]

    strand 29 "interop-async-seq" [N/A] [RUNNABLE]

    strand 30 "interop-async-seq" [N/A] [RUNNABLE]

    strand 31 "interop-async-seq" [N/A] [RUNNABLE]

    strand 32 "interop-async-seq" [N/A] [RUNNABLE]

    strand 33 "interop-async-seq" [N/A] [RUNNABLE]

    strand 34 "interop-async-seq" [N/A] [RUNNABLE]

    strand 35 "interop-async-seq" [N/A] [RUNNABLE]

    strand 36 "interop-async-seq" [N/A] [RUNNABLE]

    strand 37 "interop-async-seq" [N/A] [RUNNABLE]

    strand 38 "interop-async-seq" [N/A] [RUNNABLE]

    strand 39 "interop-async-seq" [N/A] [RUNNABLE]

    strand 40 "interop-async-seq" [N/A] [RUNNABLE]

    strand 41 "interop-async-seq" [N/A] [RUNNABLE]

    strand 42 "interop-async-seq" [N/A] [RUNNABLE]

    strand 43 "interop-async-seq" [N/A] [RUNNABLE]

    strand 44 "interop-async-seq" [N/A] [RUNNABLE]

    strand 45 "interop-async-seq" [N/A] [RUNNABLE]

    strand 46 "interop-async-seq" [N/A] [RUNNABLE]

    strand 47 "interop-async-seq" [N/A] [RUNNABLE]

    strand 48 "interop-async-seq" [N/A] [RUNNABLE]

    strand 49 "interop-async-seq" [N/A] [RUNNABLE]

    strand 50 "interop-async-seq" [N/A] [RUNNABLE]

    strand 51 "interop-async-seq" [N/A] [RUNNABLE]

group 3 [QUEUED]: [1]
strand 1 "main" [gabilan.test_u9.0:main] [WAITING]:
at gabilan.test_u9.0.1.0:main(main.bal:201)
$moduleExecute

group 4 [RUNNABLE]: [1]
strand 2 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 5 [RUNNABLE]: [1]
strand 3 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 6 [RUNNABLE]: [1]
strand 4 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 7 [RUNNABLE]: [1]
strand 5 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 8 [RUNNABLE]: [1]
strand 6 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 9 [RUNNABLE]: [1]
strand 7 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 10 [RUNNABLE]: [1]
strand 8 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 11 [RUNNABLE]: [1]
strand 9 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 12 [RUNNABLE]: [1]
strand 10 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 13 [RUNNABLE]: [1]
strand 11 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 14 [RUNNABLE]: [1]
strand 12 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 15 [RUNNABLE]: [1]
strand 13 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 16 [RUNNABLE]: [1]
strand 14 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 17 [RUNNABLE]: [1]
strand 15 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 18 [RUNNABLE]: [1]
strand 16 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 19 [RUNNABLE]: [1]
strand 17 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 20 [RUNNABLE]: [1]
strand 18 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 21 [RUNNABLE]: [1]
strand 19 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 22 [RUNNABLE]: [1]
strand 20 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 23 [RUNNABLE]: [1]
strand 21 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 24 [RUNNABLE]: [1]
strand 22 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 25 [RUNNABLE]: [1]
strand 23 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 26 [RUNNABLE]: [1]
strand 24 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 27 [RUNNABLE]: [1]
strand 25 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 28 [RUNNABLE]: [1]
strand 26 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

group 29 [RUNNABLE]: [1]
strand 27 "futureResult" [gabilan.test_u9.0:main][1] [RUNNABLE]

===========================================

Thread dump:
2024-04-22 13:37:23
Full thread dump OpenJDK 64-Bit Server VM (17.0.10+7 mixed mode):

Threads class SMR info:
_java_thread_list=0x000000012526f9a0, length=34, elements={
0x0000000126009200, 0x0000000126809e00, 0x0000000126120600, 0x000000012611ea00,
0x0000000125811e00, 0x000000012580e400, 0x000000012580ea00, 0x000000012580f000,
0x0000000126808800, 0x000000012611f800, 0x000000012611fe00, 0x000000012581c200,
0x0000000125908c00, 0x000000011700ac00, 0x000000011380ee00, 0x000000012619ea00,
0x000000012619f000, 0x0000000126199600, 0x000000011380f400, 0x0000000125909200,
0x000000012581d000, 0x000000011780a400, 0x000000011680a400, 0x000000012619b400,
0x000000011780aa00, 0x000000011700b200, 0x000000011680aa00, 0x000000011680b000,
0x0000000126199c00, 0x0000000126813a00, 0x0000000126808e00, 0x000000012619a200,
0x000000012619a800, 0x000000011680b600
}

"main" ballerina-platform/ballerina-library#1 prio=5 os_prio=31 cpu=131.68ms elapsed=32.11s tid=0x0000000126009200 nid=0x2903 waiting on condition [0x000000016dc7e000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fc59448> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler.start(Scheduler.java:274)
at gabilan.test_u9.0.$_init.main(test_u9)

"Reference Handler" ballerina-platform/ballerina-library#2 daemon prio=10 os_prio=31 cpu=0.15ms elapsed=32.10s tid=0x0000000126809e00 nid=0x4803 waiting on condition [0x000000016ead2000]
java.lang.Thread.State: RUNNABLE
at java.lang.ref.Reference.waitForReferencePendingList(java.base@17.0.10/Native Method)
at java.lang.ref.Reference.processPendingReferences(java.base@17.0.10/Reference.java:253)
at java.lang.ref.Reference$ReferenceHandler.run(java.base@17.0.10/Reference.java:215)

"Finalizer" ballerina-platform/ballerina-library#3 daemon prio=8 os_prio=31 cpu=0.14ms elapsed=32.10s tid=0x0000000126120600 nid=0x4903 in Object.wait() [0x000000016ecde000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(java.base@17.0.10/Native Method)
- waiting on <0x000000070e810178> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(java.base@17.0.10/ReferenceQueue.java:155)
- locked <0x000000070e810178> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(java.base@17.0.10/ReferenceQueue.java:176)
at java.lang.ref.Finalizer$FinalizerThread.run(java.base@17.0.10/Finalizer.java:172)

"Signal Dispatcher" ballerina-platform/ballerina-library#4 daemon prio=9 os_prio=31 cpu=0.10ms elapsed=32.09s tid=0x000000012611ea00 nid=0x7903 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE

"Service Thread" ballerina-platform/ballerina-library#5 daemon prio=9 os_prio=31 cpu=0.04ms elapsed=32.09s tid=0x0000000125811e00 nid=0x7703 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE

"Monitor Deflation Thread" ballerina-platform/ballerina-library#6 daemon prio=9 os_prio=31 cpu=2.13ms elapsed=32.09s tid=0x000000012580e400 nid=0x7503 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" ballerina-platform/ballerina-library#7 daemon prio=9 os_prio=31 cpu=47.80ms elapsed=32.09s tid=0x000000012580ea00 nid=0x5a03 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
No compile task

"C1 CompilerThread0" ballerina-platform/ballerina-library#10 daemon prio=9 os_prio=31 cpu=73.97ms elapsed=32.09s tid=0x000000012580f000 nid=0x7203 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
No compile task

"Sweeper thread" ballerina-platform/ballerina-library#11 daemon prio=9 os_prio=31 cpu=0.01ms elapsed=32.09s tid=0x0000000126808800 nid=0x5b03 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE

"Notification Thread" ballerina-platform/ballerina-library#12 daemon prio=9 os_prio=31 cpu=0.02ms elapsed=32.08s tid=0x000000012611f800 nid=0x5c03 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE

"Common-Cleaner" ballerina-platform/ballerina-library#13 daemon prio=8 os_prio=31 cpu=0.20ms elapsed=32.08s tid=0x000000012611fe00 nid=0x5f03 in Object.wait() [0x0000000170062000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(java.base@17.0.10/Native Method)
- waiting on <0x000000070e8181a8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(java.base@17.0.10/ReferenceQueue.java:155)
- locked <0x000000070e8181a8> (a java.lang.ref.ReferenceQueue$Lock)
at jdk.internal.ref.CleanerImpl.run(java.base@17.0.10/CleanerImpl.java:140)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)
at jdk.internal.misc.InnocuousThread.run(java.base@17.0.10/InnocuousThread.java:162)

"jbal-strand-exec-0" ballerina-platform/ballerina-library#16 prio=5 os_prio=31 cpu=21.68ms elapsed=31.97s tid=0x000000012581c200 nid=0x6003 waiting on condition [0x000000017026e000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070ff11b90> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-1" ballerina-platform/ballerina-library#17 prio=5 os_prio=31 cpu=2.56ms elapsed=31.97s tid=0x0000000125908c00 nid=0x6103 waiting on condition [0x000000017047a000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fe61848> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-2" ballerina-platform/ballerina-library#18 prio=5 os_prio=31 cpu=1.32ms elapsed=31.97s tid=0x000000011700ac00 nid=0x6b03 waiting on condition [0x0000000170686000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fbb5298> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-3" ballerina-platform/ballerina-library#19 prio=5 os_prio=31 cpu=1.11ms elapsed=31.97s tid=0x000000011380ee00 nid=0x6303 waiting on condition [0x0000000170892000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fb070e8> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-4" ballerina-platform/ballerina-library#20 prio=5 os_prio=31 cpu=1.45ms elapsed=31.97s tid=0x000000012619ea00 nid=0x6403 waiting on condition [0x0000000170a9e000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070f9b51c8> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-5" ballerina-platform/ballerina-library#21 prio=5 os_prio=31 cpu=1.26ms elapsed=31.97s tid=0x000000012619f000 nid=0x6903 waiting on condition [0x0000000170caa000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070f95dfc0> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-6" ballerina-platform/ballerina-library#22 prio=5 os_prio=31 cpu=2.00ms elapsed=31.97s tid=0x0000000126199600 nid=0x6703 waiting on condition [0x0000000170eb6000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070f85a6f0> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-7" ballerina-platform/ballerina-library#23 prio=5 os_prio=31 cpu=1.01ms elapsed=31.97s tid=0x000000011380f400 nid=0x8003 waiting on condition [0x00000001710c2000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070f801ec8> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-8" ballerina-platform/ballerina-library#24 prio=5 os_prio=31 cpu=2.42ms elapsed=31.97s tid=0x0000000125909200 nid=0xa903 waiting on condition [0x00000001712ce000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070f8eb078> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-9" ballerina-platform/ballerina-library#25 prio=5 os_prio=31 cpu=1.46ms elapsed=31.97s tid=0x000000012581d000 nid=0xa703 waiting on condition [0x00000001714da000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fab2410> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-10" ballerina-platform/ballerina-library#26 prio=5 os_prio=31 cpu=1.18ms elapsed=31.97s tid=0x000000011780a400 nid=0xa603 waiting on condition [0x00000001716e6000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fd8f340> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-11" ballerina-platform/ballerina-library#27 prio=5 os_prio=31 cpu=1.04ms elapsed=31.97s tid=0x000000011680a400 nid=0x8303 waiting on condition [0x00000001718f2000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fb5e0d8> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-12" ballerina-platform/ballerina-library#28 prio=5 os_prio=31 cpu=0.92ms elapsed=31.97s tid=0x000000012619b400 nid=0x8503 waiting on condition [0x0000000171afe000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fa58f28> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-13" ballerina-platform/ballerina-library#29 prio=5 os_prio=31 cpu=1.26ms elapsed=31.97s tid=0x000000011780aa00 nid=0xa303 waiting on condition [0x0000000171d0a000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070f9070a8> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-14" ballerina-platform/ballerina-library#30 prio=5 os_prio=31 cpu=1.20ms elapsed=31.97s tid=0x000000011700b200 nid=0xa103 waiting on condition [0x0000000171f16000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fa01e28> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-15" ballerina-platform/ballerina-library#31 prio=5 os_prio=31 cpu=0.77ms elapsed=31.97s tid=0x000000011680aa00 nid=0xa003 waiting on condition [0x0000000172122000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fdde930> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-16" ballerina-platform/ballerina-library#32 prio=5 os_prio=31 cpu=0.87ms elapsed=31.97s tid=0x000000011680b000 nid=0x8803 waiting on condition [0x000000017232e000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fe01c70> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-17" ballerina-platform/ballerina-library#33 prio=5 os_prio=31 cpu=0.92ms elapsed=31.97s tid=0x0000000126199c00 nid=0x8903 waiting on condition [0x000000017253a000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070feb05d0> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-18" ballerina-platform/ballerina-library#34 prio=5 os_prio=31 cpu=1.00ms elapsed=31.97s tid=0x0000000126813a00 nid=0x8b03 waiting on condition [0x0000000172746000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070ff65f10> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-19" ballerina-platform/ballerina-library#35 prio=5 os_prio=31 cpu=1.03ms elapsed=31.97s tid=0x0000000126808e00 nid=0x8d03 waiting on condition [0x0000000172952000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070ffc18e0> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-20" ballerina-platform/ballerina-library#36 prio=5 os_prio=31 cpu=1.09ms elapsed=31.97s tid=0x000000012619a200 nid=0x9e03 waiting on condition [0x0000000172b5e000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fcd9740> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-21" ballerina-platform/ballerina-library#37 prio=5 os_prio=31 cpu=0.98ms elapsed=31.97s tid=0x000000012619a800 nid=0x8f03 waiting on condition [0x0000000172d6a000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fc041d8> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"jbal-strand-exec-22" ballerina-platform/ballerina-library#38 prio=5 os_prio=31 cpu=2.33ms elapsed=31.97s tid=0x000000011680b600 nid=0x9b03 waiting on condition [0x0000000172f76000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
- parking to wait for <0x000000070fd4c990> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.10/AbstractQueuedSynchronizer.java:715)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@17.0.10/AbstractQueuedSynchronizer.java:1047)
at java.util.concurrent.CountDownLatch.await(java.base@17.0.10/CountDownLatch.java:230)
at myapp.app.App.getResource(App.java:59)
at gabilan.test_u9.0.main.getResource(main.bal:308)
at gabilan.test_u9.0.main.test(main.bal:304)
at gabilan.test_u9.0.main.$test$lambda$_0$(main.bal:197)
at gabilan.test_u9.0.main$$Lambda$137/0x0000000800146618.apply(Unknown Source)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at io.ballerina.runtime.internal.scheduling.Scheduler$$Lambda$24/0x000000080012e858.run(Unknown Source)
at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"VM Thread" os_prio=31 cpu=4.75ms elapsed=32.11s tid=0x000000012516c5d0 nid=0x4d03 runnable

"GC Thread#0" os_prio=31 cpu=1.35ms elapsed=32.11s tid=0x000000012511cd10 nid=0x3103 runnable

"GC Thread#1" os_prio=31 cpu=0.99ms elapsed=31.95s tid=0x0000000102a58640 nid=0x9a03 runnable

"GC Thread#2" os_prio=31 cpu=1.08ms elapsed=31.95s tid=0x0000000102a58f10 nid=0x9903 runnable

"GC Thread#3" os_prio=31 cpu=1.09ms elapsed=31.95s tid=0x0000000102a597e0 nid=0x9203 runnable

"GC Thread#4" os_prio=31 cpu=1.20ms elapsed=31.95s tid=0x0000000102a5a0b0 nid=0x9303 runnable

"GC Thread#5" os_prio=31 cpu=1.11ms elapsed=31.95s tid=0x0000000102a5a980 nid=0x9503 runnable

"GC Thread#6" os_prio=31 cpu=1.16ms elapsed=31.95s tid=0x0000000102a5b250 nid=0xaa03 runnable

"GC Thread#7" os_prio=31 cpu=1.08ms elapsed=31.95s tid=0x0000000102a5bb20 nid=0xfe03 runnable

"GC Thread#8" os_prio=31 cpu=1.02ms elapsed=31.95s tid=0x0000000102a5c3f0 nid=0xac03 runnable

"GC Thread#9" os_prio=31 cpu=1.06ms elapsed=31.95s tid=0x0000000102a5d0b0 nid=0xfd03 runnable

"G1 Main Marker" os_prio=31 cpu=0.01ms elapsed=32.12s tid=0x000000012511db60 nid=0x3703 runnable

"G1 Conc#0" os_prio=31 cpu=0.01ms elapsed=32.12s tid=0x000000012511e8e0 nid=0x3403 runnable

"G1 Refine#0" os_prio=31 cpu=0.01ms elapsed=32.12s tid=0x0000000125138d70 nid=0x4103 runnable

"G1 Service" os_prio=31 cpu=3.70ms elapsed=32.12s tid=0x0000000125139aa0 nid=0x4203 runnable

"VM Periodic Task Thread" os_prio=31 cpu=11.65ms elapsed=32.09s tid=0x00000001251b7900 nid=0x5d03 waiting on condition

JNI global refs: 9, weak refs: 0

Heap
garbage-first heap total 262144K, used 11283K [0x0000000700000000, 0x0000000800000000)
region size 2048K, 7 young (14336K), 2 survivors (4096K)
Metaspace used 12438K, committed 12608K, reserved 1114112K
class space used 1322K, committed 1408K, reserved 1048576K

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Runtime

Related issue(s) (optional)

ballerina-platform/ballerina-library#6474

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@gabilang gabilang added Type/Bug Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime labels Apr 22, 2024
@gabilang gabilang self-assigned this Apr 22, 2024
@gabilang
Copy link
Contributor Author

@gabilang
Copy link
Contributor Author

gabilang commented Apr 22, 2024

The same issue observed when using CompletableFuture and Semaphore as well.

@gabilang
Copy link
Contributor Author

All strand executor threads are on waiting state:
Screenshot 2024-04-22 at 15 22 39

@warunalakshitha warunalakshitha moved this from BackLog to In Progress in Ballerina Team Main Board Apr 26, 2024
@warunalakshitha
Copy link
Contributor

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.

[1] https://github.com/ballerina-platform/ballerina-lang/tree/master/bvm/ballerina-runtime#calling-a-ballerina-object-method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reason/Invalid Issue is invalid. Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug
Projects
Archived in project
Development

No branches or pull requests

2 participants