Skip to content

Commit f6e96a2

Browse files
committed
Add BlockHound exception for ConcurrentReferenceHashMap$ReferenceManager
This commit adds a SpringCoreBlockHoundIntegration configuration to allows `pollForPurge` method to block. Closes gh-33450
1 parent daea923 commit f6e96a2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

spring-core/src/main/java/org/springframework/core/ReactiveAdapterRegistry.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,13 @@ public static class SpringCoreBlockHoundIntegration implements BlockHoundIntegra
442442
public void applyTo(BlockHound.Builder builder) {
443443
// Avoid hard references potentially anywhere in spring-core (no need for structural dependency)
444444

445-
String className = "org.springframework.util.ConcurrentReferenceHashMap$Segment";
446-
builder.allowBlockingCallsInside(className, "doTask");
447-
builder.allowBlockingCallsInside(className, "clear");
448-
builder.allowBlockingCallsInside(className, "restructure");
445+
String segmentClassName = "org.springframework.util.ConcurrentReferenceHashMap$Segment";
446+
builder.allowBlockingCallsInside(segmentClassName, "doTask");
447+
builder.allowBlockingCallsInside(segmentClassName, "clear");
448+
builder.allowBlockingCallsInside(segmentClassName, "restructure");
449+
450+
String referenceManagerClassName = "org.springframework.util.ConcurrentReferenceHashMap$ReferenceManager";
451+
builder.allowBlockingCallsInside(referenceManagerClassName, "pollForPurge");
449452
}
450453
}
451454

0 commit comments

Comments
 (0)