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

[Native Image] If a Java sub-thread is not closed, the TearDown Isolate process keeps waiting. #10382

Open
1 of 2 tasks
MicroGery opened this issue Dec 27, 2024 · 2 comments
Open
1 of 2 tasks
Assignees

Comments

@MicroGery
Copy link

Describe the Issue

I construct a scenario where Java code takes a child thread from the thread pool to execute a task, but it does not close properly. When I TearDown Isolate, the interface keeps waiting for the thread to close.

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

java 17.0.10 2024-01-16 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 17.0.10+11.1 (build 17.0.10+11-LTS-jvmci-23.0-b27)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.10+11.1 (build 17.0.10+11-LTS-jvmci-23.0-b27, mixed mode, sharing)

Operating System and Version

Red Hat Enterprise Linux Server 7.6 (Maipo)

Troubleshooting Confirmation

Run Command

I dynamically loaded my native_image.so

Expected Behavior

I would like to have an interface to force all Java threads to shut down and return to the C/C++ logic that calls Isolate.

Actual Behavior

I would like to have an interface to force all Java threads to shut down and return to the C/C++ logic that calls Isolate.

Steps to Reproduce

private static final ExecutorService testPool = Executors.newFixedThreadPool(2, r -> new Thread(r, "test_pool_xxx"));
testPool.execute(() -> {
while (true) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
System.out.println("test thread interrupted. " + Thread.currentThread().getClass().getName());
break;
}
}
});

Additional Context

No response

Run-Time Log Output and Error Messages

No response

@selhagani
Copy link
Member

Hi @MicroGery,

Thank you for reaching out to us!
Could you please try testing using the latest available version of GraalVM here and let me know if you're still experiencing the issue.

@MicroGery
Copy link
Author

Member
OK, I'll try to switch to the latest version and rerun my test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants