-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #186: runtime error: integer divide by zero
When fabio is presented with more than 200 targets for a single route then a rounding error had the effect that no target would get traffic which subsequently lead to a division by zero error in a code path which did not expect an empty list of targets. This change modifies the distribution algorithm as follows: * The case where all targets receive an equal amount of traffic has now a fast path which just returns the list of targets. * For the other case a larger ring of 10.000 slots is always used to achieve a certain amount of accuracy. In addition, all targets that have a non-zero weight will use at least one slot to work around rounding issues and the fact that some servers would not receive traffic although they are alive and healthy. This should guarantee an unlimited number of instances for a single route.
- Loading branch information
1 parent
e259825
commit 7fc68e4
Showing
4 changed files
with
407 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.