【问题标题】:BlockHound Detects WebClient's ExchangeFunction's .next() Method As BlockingBlockHound 将 WebClient 的 ExchangeFunction 的 .next() 方法检测为阻塞
【发布时间】:2020-10-13 10:00:23
【问题描述】:

我正在使用 BlockHound 分析我的反应器应用程序。我的ExchangeFunction 上有一个过滤器:

@Override
public Mono<ClientResponse> filter(ClientRequest request, ExchangeFunction next) {
final ClientRequest.Builder builder = ClientRequest.from(request);
return Mono.defer(() -> next.exchange(builder.build())) //detects blocking call
    .transform(reactiveUtil::contextualize)
    .publishOn(Schedulers.parallel());
}

BlockHoundnext.exchange() 上检测到阻塞调用。现在既然我使用WebClientNetty,为什么这个调用是非阻塞的?在elastic 线程上订阅它并没有帮助。

【问题讨论】:

标签: reactive-programming project-reactor reactor reactor-netty


【解决方案1】:

根据您的要点,BlockHound 将 java.io.FileInputStream.readBytes(..) 检测为 SSL 握手中的深层阻塞。

此问题已在 https://github.com/reactor/reactor-netty/issues/939 中报告,并且似乎已在最新版本中得到解决。

【讨论】:

    猜你喜欢
    • 2021-02-22
    • 1970-01-01
    • 1970-01-01
    • 2010-10-07
    • 2021-11-12
    • 1970-01-01
    • 1970-01-01
    • 2013-08-16
    • 1970-01-01
    相关资源
    最近更新 更多