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
Copy file name to clipboardExpand all lines: instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/cache/weaklockfree/AbstractWeakConcurrentMap.java
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -236,6 +236,13 @@ protected V defaultValue(K key) {
236
236
237
237
/** Cleans all unused references. */
238
238
publicstaticvoidexpungeStaleEntries() {
239
+
// Skip expunging stale entries if we are running on a virtual thread.
240
+
// See https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/17847
241
+
// Stale entries are also expunged from the background thread, see the runCleanup method below.
242
+
if (ThreadUtil.isVirtualThread(Thread.currentThread())) {
243
+
return;
244
+
}
245
+
239
246
Reference<?> reference;
240
247
while ((reference = REFERENCE_QUEUE.poll()) != null) {
0 commit comments