From 2a3389e6a7899d1c8aabf4be044bb38aed02645a Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Fri, 31 Jan 2020 11:39:14 -0500 Subject: [PATCH] Updates CustomBlockHoundIntegration to whitelist more netty --- .../CustomBlockHoundIntegration.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/spring-cloud-gateway-core/src/test/java/reactor/blockhound/integration/CustomBlockHoundIntegration.java b/spring-cloud-gateway-core/src/test/java/reactor/blockhound/integration/CustomBlockHoundIntegration.java index 4efe75ef..435ada0a 100644 --- a/spring-cloud-gateway-core/src/test/java/reactor/blockhound/integration/CustomBlockHoundIntegration.java +++ b/spring-cloud-gateway-core/src/test/java/reactor/blockhound/integration/CustomBlockHoundIntegration.java @@ -25,10 +25,15 @@ public class CustomBlockHoundIntegration implements BlockHoundIntegration { @Override public void applyTo(BlockHound.Builder builder) { - /* - * builder.blockingMethodCallback(it -> { Error error = new Error(it.toString()); - * error.printStackTrace(); throw error; }); - */ + // builder.blockingMethodCallback(it -> { + // Error error = new Error(it.toString()); + // error.printStackTrace(); + // throw error; + // }); + + // Uses Unsafe#park + builder.allowBlockingCallsInside("reactor.core.scheduler.SchedulerTask", + "dispose"); // Uses // ch.qos.logback.classic.spi.PackagingDataCalculator#getImplementationVersion @@ -69,6 +74,12 @@ public class CustomBlockHoundIntegration implements BlockHoundIntegration { "execute"); builder.allowBlockingCallsInside( "io.netty.util.concurrent.SingleThreadEventExecutor$6", "run"); + // builder.allowBlockingCallsInside("io.netty.util.concurrent.GlobalEventExecutor", + // "takeTask"); + // builder.allowBlockingCallsInside("io.netty.util.concurrent.GlobalEventExecutor", + // "addTask"); + builder.allowBlockingCallsInside( + "io.netty.util.concurrent.FastThreadLocalRunnable", "run"); // SECURITY RELATED