server: Set max refresh sessions threshold to 8 #2085
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this pull request do? Explain your changes. (required)
This PR sets the max refresh sessions threshold to 8.
Prior to this PR, a B would refresh its session list (resulting in running orchestrator discovery to create a new session list) whenever the size of the list falls below
numOrchs / 2
wherenumOrchs
is the # of Os that the B is aware of. The problem with this check is illustrated by the following example:The consequence is that B can end up running discovery/refreshing its session list really frequently.
This PR changes B's behavior so that if
numOrchs / 2 > 8
, then B will only refresh its session list if the size falls below 8. However, ifnumOrchs / 2 < 8
then B will refresh its session list if the size falls belownumOrchs / 2
. This means that if B is aware of a lot of Os (i.e. on the public network) it will wait until the size of the session list falls to a lower level before refreshing. But, if B is not aware of many Os (i.e. in a smaller local private network) it will refresh when the session list is at a higher level.Specific updates (required)
See commit history.
How did you test each of these updates (required)
Tested manually. Would like to add unit tests for this area of the codebase but haven't gotten to it yet...
Does this pull request close any open issues?
Fixes #2080
Checklist:
make
runs successfully./test.sh
pass