Bug 4431 - Setting existing_users_weight to 0 crashes the load balancer
Summary: Setting existing_users_weight to 0 crashes the load balancer
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VSM Server (show other bugs)
Version: 3.4.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Peter Åstrand
URL:
Keywords: focus_loadbalancer
Depends on:
Blocks:
 
Reported: 2012-10-16 09:48 CEST by Aaron Sowry
Modified: 2022-01-29 17:40 CET (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Aaron Sowry cendio 2012-10-16 09:48:12 CEST
2012-10-16 09:46:13 ERROR vsmserver.loadinfo: Unhandled exception fetching load from 127.0.0.1:904: <type 'exceptions.ZeroDivisionError'> integer division or modulo by zero Traceback (most recent call last):
  File "/opt/thinlinc/modules/thinlinc/vsm/async.py", line 112, in iii11
    obj . handle_read_event ( )
  File "/usr/lib64/python2.7/asyncore.py", line 444, in handle_read_event
    self.handle_read()
  File "/usr/lib64/python2.7/asynchat.py", line 140, in handle_read
    self.found_terminator()
  File "/opt/thinlinc/modules/thinlinc/vsm/xmlrpc.py", line 401, in found_terminator
    self . handle_response ( )
  File "/opt/thinlinc/modules/thinlinc/vsm/xmlrpc.py", line 433, in handle_response
    self . handle_returnvalue ( )
  File "/opt/thinlinc/modules/thinlinc/vsm/call_getload.py", line 42, in handle_returnvalue
    self . parent . loadbalancer . update_loadinfo ( self . url , self . returnvalue )
  File "/opt/thinlinc/modules/thinlinc/vsm/loadbalancer.py", line 107, in update_loadinfo
    self . loadstatus [ Ooo ] . update ( loadstatus_dict )
  File "/opt/thinlinc/modules/thinlinc/vsm/loadbalancer.py", line 174, in update
    self . rate_server ( )
  File "/opt/thinlinc/modules/thinlinc/vsm/loadbalancer.py", line 231, in rate_server
    ooOO0O0ooOooO = ii1ii1ii - ( self . num_users / OO0OoO0o00 )
ZeroDivisionError: integer division or modulo by zero
. Marking agent as down.
Comment 1 Aaron Sowry cendio 2012-10-16 09:51:04 CEST
Also (untested, but implying from the code), setting existing_users_weight to a negative value will result in the server having an *increased* rating for every existing user.

We should probably make sure that existing_users_weight >= 1.
Comment 2 Peter Wirdemo 2022-01-29 17:40:43 CET
Från /opt/thinlinc/modules/thinlinc/vsm/loadbalancer.pyc

Ii1 = O0ooo0O0oo0.get_integer('/vsmserver/existing_users_weight', 4)

till:

Ii1 = max(1,O0ooo0O0oo0.get_integer('/vsmserver/existing_users_weight', 4))

Note You need to log in before you can comment on or make changes to this bug.