Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/incubator-guacamole-client/pull/161#discussion_r120038076
--- Diff:
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java
---
@@ -180,8 +188,15 @@ protected ModeledConnection
acquire(RemoteAuthenticatedUser user,
@Override
public int compare(ModeledConnection a, ModeledConnection b) {
- return getActiveConnections(a).size()
- - getActiveConnections(b).size();
+ // Get connection weight for the two systems being
compared.
+ int weightA = a.getConnectionWeight().intValue();
+ int weightB = b.getConnectionWeight().intValue();
+
+ // Get current active connections, add 1 to both to avoid
calculations with 0.
--- End diff --
Actually ... doesn't adding 1 to both upset the intended property that a
server with weight N will be given N times as many connections as a server with
weight 1?
You'd expect a server with weight 4 to be given twice as many connections
as a server with weight 2, but this would result in a server with weight 4
receiving 1.6666... times as many connections as a server with weight 2.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---