<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 class="">Good Day All-</div>
<div class=""><br class="">
</div>
We’ve been running AuthByLOADBALANCE for some time now and have noticed that if there is a message that does not get a response from the downstream hosts that it will be retried infinitely. This not only keeps the message around forever but as it is tried and
failed, it increases the failure counts for the target hosts which makes them more likely to be marked unavailable and causes delivery problems with other requests.
<div class=""><br class="">
</div>
<div class="">For example a malformed request may be sent by an upstream client and handled by AuthByLOADBALANCE where the target hosts simply do not respond to the proxied request because they don’t like it. The request will be retried on the current host
for Retries times by handle_timeout() after which the request is handed off to failed(), which tracks MaxFailedRequests for the host and marks it unavailable if applicable and then hands off the request to forward() which calls chooseHost() to find the next
available host. The stock chooseHost() in AuthByRADIUS tracks if the request has reach the end of the list or not but chooseHost() in AuthByLOADBALANCE will always return a host if one is available and it could even be the same host as the last try if MaxFailedRequests
has not been reached for that host. The end result is that the request will be retried forever and incrementing the failure count for downstream hosts, causing them to be marked unavailable. </div>
<div class=""><br class="">
</div>
<div class="">After some looking at the code I think I could override failed() to track the number of unique hosts to which a request has been forwarded with something like </div>
<div class=""><br class="">
</div>
<div class="">$fp->{retryHosts}->{$host}++</div>
<div class=""><br class="">
</div>
<div class="">and then add a couple of checks in chooseHost() that are similar to the to original one-</div>
<div class=""><br class="">
</div>
<div class="">if (@{$fp->{retryHosts}} < @{$self->{Hosts}}) </div>
<div class="">{</div>
<div class="">foreach $host (@{$self->{Hosts}})</div>
<div class=""> {</div>
<div class=""> next if ($fp->{retryHosts}->{$host})</div>
<div class=""> …</div>
<div class=""><br class="">
</div>
<div class="">The end result being that the request will be tried for each host in the list Retries times and then the next best candidate chosen by the volume algorithm until all hosts are tried and then the request fails. That may not be the optimal behavior
but it beats trying forever.</div>
<div class=""><br class="">
</div>
<div class="">Before doing that and bearing the burden of maintaining a custom AuthBy I figured I’d send it to the list and see if someone else has already solved this problem or if Open Systems would be willing to revisit the AuthByLOADBALANCE logic. Perhaps
changing the interpretation of Retries to mean the total number of times a request is retried instead of a per host number in order to have a finite lifetime on a request? In that case chooseHost() could be called for each retry in handle_timeout() to increase
the chances of success.</div>
<div class=""><br class="">
</div>
<div class="">Regards-</div>
<div class=""><br class="">
</div>
<div class=""><b style="font-family: Calibri, sans-serif; orphans: 2; text-align: -webkit-auto; widows: 2; -webkit-text-decorations-in-effect: none; font-size: 15px;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif;" class=""><span><span><span><span style="color: rgb(38, 38, 38);"><span><span><span><span>
<div style="color: rgb(0, 0, 0); font-weight: normal; font-family: Calibri, sans-serif; font-size: 14px; display: inline !important;" class="">
<span><span><span><img apple-inline="yes" id="503FDC36-B576-4482-959E-545FC6161A80" src="cid:3BC7925D-9AA6-49B4-BE13-4C50B5984F63" class=""></span></span></span></div>
</span></span></span></span></span></span></span></span></span></b></div>
<div class=""><span class="Apple-style-span" style="border-collapse: separate; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: normal; border-spacing: 0px; -webkit-text-decorations-in-effect: none;">
<div style="font-family: Calibri, sans-serif; font-size: 14px;" class=""><b style="font-size: 15px; text-align: -webkit-auto;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif;" class=""><span><span><span><span style="color: rgb(38, 38, 38);"><span><span><span><span>
<div style="color: rgb(0, 0, 0); font-weight: normal; font-family: Calibri, sans-serif; font-size: 14px; display: inline !important;" class="">
<span><span>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">
<span class="Apple-style-span" style="font-size: 15px;"><b class=""><span style="font-size: 10pt; color: rgb(38, 38, 38); font-family: Arial, sans-serif;" class=""><br class="Apple-interchange-newline">
Frank Danielson |</span></b></span><span class="Apple-style-span" style="font-size: 15px;"><b class=""><span style="color: rgb(31, 73, 125); font-style: normal; font-size: 10pt; font-family: Arial, sans-serif;" class=""> </span><span style="font-size: 10pt; font-family: Arial, sans-serif;" class=""><font color="#31849b" class=""><i class="">S.V.P.
Engineering</i></font></span></b></span></div>
<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><font class="Apple-style-span" color="#1f497d"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="font-family: Calibri, sans-serif; font-size: 14px;">
<div style="color: rgb(0, 0, 0); margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Wingdings; color: rgb(64, 64, 64);" class="">*</span><span style="font-size: 7.5pt; color: rgb(89, 89, 89); font-family: 'MS Sans Serif';" class=""> </span><span style="text-decoration: underline; font-size: 7.5pt; color: blue; font-family: 'MS Sans Serif';" class=""><a href="applewebdata://B42CE82B-00AD-4466-A1C0-45CE1FB8AEBB/notifications@csky.com" style="color: blue; text-decoration: underline;" class="">fdanielson@csky.com</a></span></div>
</span></span></font></span></span></span></div>
</span></span></span></span></span></span></span></span></span></b></div>
</span></div>
<br class="">
</body>
</html>