Skip to content

Commit

Permalink
rtpproxy+rtpengine: fair election when the first try is disabled
Browse files Browse the repository at this point in the history
When a first attempt to use a rtpproxy/rtpengine node picks a disabled
node, the next attempt should not consider the disabled nodes at all.

(cherry picked from commit 9d5dd95)
  • Loading branch information
razvancrainea committed May 2, 2022
1 parent 0cca86f commit 4408617
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/rtpengine/rtpengine.c
Expand Up @@ -2608,7 +2608,8 @@ select_rtpe_node(str callid, int do_test, struct rtpe_set *set)
continue;
}
}
sumcut -= node->rn_weight;
if (!node->rn_disabled || !was_forced)
sumcut -= node->rn_weight;
node = node->rn_next;
}
/* No node list */
Expand Down
3 changes: 2 additions & 1 deletion modules/rtpproxy/rtpproxy.c
Expand Up @@ -2307,7 +2307,8 @@ select_rtpp_node(struct sip_msg * msg,
continue;
}
}
sumcut -= node->rn_weight;
if (!node->rn_disabled || !was_forced)
sumcut -= node->rn_weight;
node = node->rn_next;
}
/* No node list */
Expand Down

0 comments on commit 4408617

Please sign in to comment.