【问题标题】:Hystrix circuit is always open even though external system is back online即使外部系统重新上线,Hystrix 电路也始终打开
【发布时间】:2018-01-14 18:27:30
【问题描述】:

我们在应用中添加了一些外部系统。我们正在使用 Hystrix 命令使用 apache http 客户端库执行远程 REST 调用。

我们遇到了这样一个问题,即对于一个外部服务器电路始终打开并且我们获得默认回退。减少睡眠窗口并没有真正的帮助

public Command(CloseableHttpClient httpClient, HttpRequestBase httpRequest) {
        super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("MyServer"))
                .andThreadPoolKey(HystrixThreadPoolKey.Factory
                        .asKey(ServerManager.WorkManager.name())));
        ConfigurationManager.getConfigInstance().setProperty(
                "hystrix.command.Command.execution.isolation.thread.timeoutInMilliseconds",
                getExecutionTimeout());
        ConfigurationManager.getConfigInstance().setProperty(
                "hystrix.command.Commad.circuitBreaker.sleepWindowInMilliseconds",
                getIgnoreTimeout());

        this.httpRequest = httpRequest;
        this.httpClient = httpClient;
}

对于其他系统,断路器按预期工作。 即使断路器似乎已打开,也尝试重新启动应用程序服务器。

是否存在边缘情况或其他情况?还是 Hystrix 命令应该以不同的方式处理?

【问题讨论】:

    标签: java hystrix


    【解决方案1】:

    问题不在于 Hystrix,而在于 http 连接泄漏。 Http 连接未释放回池。所以发生了连接泄漏。

    【讨论】:

      猜你喜欢
      • 2020-10-29
      • 2020-04-23
      • 2017-05-29
      • 1970-01-01
      • 2019-12-17
      • 2020-04-13
      • 1970-01-01
      • 2016-03-24
      • 2023-01-28
      相关资源
      最近更新 更多