akka/akka-http

Akka Http Client pool connections are not reestablished after DNS positive-ttl

Open

#1,226 建立於 2017年6月23日

在 GitHub 查看
 (25 留言) (15 反應) (0 負責人)Scala (598 fork)batch import
1 - triageddiscusshelp wantedt:client

倉庫指標

Star
 (1,311 star)
PR 合併指標
 (平均合併 1天 10小時) (30 天內合併 2 個 PR)

描述

We have found that under some circumstances, Akka's Http client is not honoring the positive-ttl expiry value, not picking up new DNS entries.

It looks as if under load, and using the default http connection pool, the client will never try resolving again the DNS entry if the connection is not closed, regardless of the positive-ttl value.

Steps to reproduce: 0. Using akka-http 10.0.6 and akka-core 2.5.2

  1. DNS resolves test.com to server_A with ip_A
  2. Run akka http application with following settings: dns.inet-address { positive-ttl = 30s negative-ttl = 30s }
  3. Run load continuously to this akka http app which does requests to test.com
  4. Change DNS entry (in /etc/hosts, for instance) to point to ip_B. NOTE: server_A with ip_A is still running.
  5. Wait for positive-ttl dns cache expiry (30 seconds, in this example)

Expected behaviour:

  • DNS cache expires, every new request should be sent to ip_B.

Current behaviour:

  • New requests after DNS expiry time are still going to ip_A.
  • The only way to have the akka http application to pick up the new DNS entry is by restarting.

貢獻者指南