<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class="">Hi there,</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class="">In netty we support using BlockHound[1] to detect if people do blocking operations within the EventLoop and so notify them that this should not be done. While running our integration tests with TLS1.3 we noticed that unwrap(…) may trigger an FileInputStream.read(…) which in theory could block for a long time. I was assuming that such an operation should only be done after SSLEngine.* returns NEED_TASK and so be delegated to another ThreadPool via getTask().</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class="">Now the question(s):</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class="">* Is my assumption incorrect ?</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class="">* If my assumption is correct should we fix this ?</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class="">Here is the stack trace when such a blocking call is detected:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class="">reactor.blockhound.BlockingOperationError: Blocking call! java.io.FileInputStream#readBytes</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/java.io.FileInputStream.readBytes(FileInputStream.java)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/java.io.FileInputStream.read(FileInputStream.java:273)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/java.io.FilterInputStream.read(FilterInputStream.java:133)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:424)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.provider.NativePRNG$RandomIO.ensureBufferValid(NativePRNG.java:526)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.provider.NativePRNG$RandomIO.implNextBytes(NativePRNG.java:545)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.provider.NativePRNG$NonBlocking.engineNextBytes(NativePRNG.java:318)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/java.security.SecureRandom.nextBytes(SecureRandom.java:741)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.RandomCookie.<init>(RandomCookie.java:67)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.SessionId.<init>(SessionId.java:45)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.NewSessionTicket$NewSessionTicketKickstartProducer.produce(NewSessionTicket.java:225)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.Finished$T13FinishedConsumer.onConsumeFinished(Finished.java:1100)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.Finished$T13FinishedConsumer.consume(Finished.java:867)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:418)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:177)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.SSLEngineImpl.decode(SSLEngineImpl.java:681)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:636)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:454)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:433)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at java.base/javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:634)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at io.netty.handler.ssl.SslHandler$SslEngineType$3.unwrap(SslHandler.java:282)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1380)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1275)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1322)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue";" class="">[1] <a href="https://github.com/reactor/BlockHound" class="">https://github.com/reactor/BlockHound</a></div></body></html>