1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package io.netty5.util.internal;
18
19 import io.netty5.util.concurrent.FastThreadLocalThread;
20 import reactor.blockhound.BlockHound;
21 import reactor.blockhound.integration.BlockHoundIntegration;
22
23
24
25
26
27 class Hidden {
28
29
30
31
32
33
34
35 @UnstableApi
36 public static final class NettyBlockHoundIntegration implements BlockHoundIntegration {
37
38 @Override
39 public void applyTo(BlockHound.Builder builder) {
40 builder.allowBlockingCallsInside(
41 "io.netty5.channel.nio.NioEventLoop",
42 "handleLoopException"
43 );
44
45 builder.allowBlockingCallsInside(
46 "io.netty5.channel.kqueue.KQueueEventLoop",
47 "handleLoopException"
48 );
49
50 builder.allowBlockingCallsInside(
51 "io.netty5.channel.epoll.EpollEventLoop",
52 "handleLoopException"
53 );
54
55 builder.allowBlockingCallsInside(
56 "io.netty5.util.HashedWheelTimer",
57 "start"
58 );
59
60 builder.allowBlockingCallsInside(
61 "io.netty5.util.HashedWheelTimer",
62 "stop"
63 );
64
65 builder.allowBlockingCallsInside(
66 "io.netty5.util.HashedWheelTimer$Worker",
67 "waitForNextTick"
68 );
69
70 builder.allowBlockingCallsInside(
71 "io.netty5.util.concurrent.SingleThreadEventExecutor",
72 "confirmShutdown"
73 );
74 builder.allowBlockingCallsInside("io.netty5.util.concurrent.GlobalEventExecutor",
75 "addTask");
76
77 builder.allowBlockingCallsInside("io.netty5.util.concurrent.GlobalEventExecutor",
78 "takeTask");
79
80 builder.allowBlockingCallsInside(
81 "io.netty5.util.concurrent.SingleThreadEventExecutor",
82 "addTask");
83
84 builder.allowBlockingCallsInside(
85 "io.netty5.util.concurrent.SingleThreadEventExecutor",
86 "takeTask");
87
88 builder.allowBlockingCallsInside(
89 "io.netty5.handler.ssl.SslHandler",
90 "handshake"
91 );
92
93 builder.allowBlockingCallsInside(
94 "io.netty5.handler.ssl.SslHandler",
95 "runAllDelegatedTasks"
96 );
97 builder.allowBlockingCallsInside(
98 "io.netty5.handler.ssl.SslHandler",
99 "runDelegatedTasks"
100 );
101
102 builder.allowBlockingCallsInside(
103 "io.netty5.handler.ssl.ReferenceCountedOpenSslClientContext$ExtendedTrustManagerVerifyCallback",
104 "verify");
105
106 builder.allowBlockingCallsInside(
107 "io.netty.handler.ssl.JdkSslContext$Defaults",
108 "init");
109
110
111
112 builder.allowBlockingCallsInside(
113 "sun.security.ssl.SSLEngineImpl",
114 "unwrap");
115
116 builder.allowBlockingCallsInside(
117 "sun.security.ssl.SSLEngineImpl",
118 "wrap");
119
120 builder.allowBlockingCallsInside(
121 "io.netty5.resolver.dns.UnixResolverDnsServerAddressStreamProvider",
122 "parse");
123
124 builder.allowBlockingCallsInside(
125 "io.netty5.resolver.dns.UnixResolverDnsServerAddressStreamProvider",
126 "parseEtcResolverSearchDomains");
127
128 builder.allowBlockingCallsInside(
129 "io.netty5.resolver.dns.UnixResolverDnsServerAddressStreamProvider",
130 "parseEtcResolverOptions");
131
132 builder.allowBlockingCallsInside(
133 "io.netty5.resolver.HostsFileEntriesProvider$ParserImpl",
134 "parse");
135
136 builder.allowBlockingCallsInside(
137 "io.netty5.util.NetUtil$SoMaxConnAction",
138 "run");
139
140 builder.nonBlockingThreadPredicate(p -> thread ->
141 p.test(thread) || thread instanceof FastThreadLocalThread);
142 }
143 }
144 }