You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public R waitAndWork() throws InterruptedException, Throwable {
synchronized (SyncFutureWaiter.this) {
while (!complete) {
Runnable task = tasks.poll();
if (task == null) {
SyncFutureWaiter.this.wait();
} else {
task.run();
}
}
....
.....
}
}
The use of Sync block and Object.wait ( SyncFutureWaiter.this.wait() ) here causes the carrier thread to be pinned in this code when running with Virtual threads with Java-21.
These code need to be replaced with a combination of ReentrantLock and Condition.await()/Condition.signalAll() , which are loom friendly and doesn't cause the carrier thread to be pinned.
mricken
added
the
SDK
Issue pertains to the SDK itself and not specific to any service
label
Oct 30, 2024
observed thread pinning happening for GenerativeAiInferenceClient for Helidon 4x version for AI calls for OCI sdk.
#2270 "[0x453f951d 0x5e59747f] WebServer socket" virtual
java.base/java.lang.Object.wait0(Native Method)
java.base/java.lang.Object.wait(Object.java:366)
java.base/java.lang.Object.wait(Object.java:339)
com.oracle.bmc.http.internal.SyncFutureWaiter$Waiter.waitAndWork(SyncFutureWaiter.java:61)
com.oracle.bmc.http.internal.SyncFutureWaiter.listenForResult(SyncFutureWaiter.java:32)
com.oracle.bmc.http.internal.ClientCall.callSync(ClientCall.java:1101)
com.oracle.bmc.generativeaiinference.GenerativeAiInferenceClient.chat(GenerativeAiInferenceClient.java:114)
#1582 "[0x453f951d 0x74dfd5cd] WebServer socket" virtual
java.base/java.lang.Object.wait0(Native Method)
java.base/java.lang.Object.wait(Object.java:366)
java.base/java.lang.Object.wait(Object.java:339)
com.oracle.bmc.http.internal.SyncFutureWaiter$Waiter.waitAndWork(SyncFutureWaiter.java:61)
com.oracle.bmc.http.internal.SyncFutureWaiter.listenForResult(SyncFutureWaiter.java:32)
com.oracle.bmc.http.internal.ClientCall.callSync(ClientCall.java:1101)
com.oracle.bmc.generativeaiinference.GenerativeAiInferenceClient.embedText(GenerativeAiInferenceClient.java:143)
The text was updated successfully, but these errors were encountered: