Skip to content

Commit

Permalink
Merge pull request akka#25744 from akka/dontWarnAboutOldProtocolUse
Browse files Browse the repository at this point in the history
Don't warn about old DNS protocol use
  • Loading branch information
patriknw authored Oct 15, 2018
2 parents 1b8da91 + 32c4554 commit af240d7
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ private[io] final class AsyncDnsManager(val ext: DnsExt) extends Actor
case Dns.Resolve(name)
// adapt legacy protocol to new protocol
log.debug("Resolution request for {} from {}", name, sender())
warnAboutOldProtocolUse(name)
val adapted = DnsProtocol.Resolve(name)
val reply = (resolver ? adapted).mapTo[DnsProtocol.Resolved]
.map { asyncResolved
Expand All @@ -85,14 +84,5 @@ private[io] final class AsyncDnsManager(val ext: DnsExt) extends Actor
case CacheCleanup
cacheCleanup.foreach(_.cleanup())
}

private def warnAboutOldProtocolUse(name: String): Unit = {
val warnAtMostTimes = 10
if (oldProtocolWarningLoggedTimes < warnAtMostTimes) {
oldProtocolWarningLoggedTimes += 1
log.warning("Received Dns.Resolve({}) message while Async DNS resolver active. Please use the new API [akka.io.dns.DnsProtocol] to issue resolve requests. " +
"(This warning will be logged at most {} times)", name, warnAtMostTimes)
}
}
}

0 comments on commit af240d7

Please sign in to comment.