[Swift-devel] Re: scheduler foo
Ben Clifford
benc at hawaga.org.uk
Mon Jul 21 08:14:02 CDT 2008
poking more at this. the approach used in the code at the moment seems to
have a few problems:
The frist, in situations like the below code fragment the first
overloadedCount adjustment
takes away the overloadedness of the host in question, then adds the new
overloadedness back. However, it relies on the first checkOverloaded
returning the (negative of the) same as what has been added previously -
either by a previous checkOverloaded call or by a timer thread.
This seems to not always happen.
overloadedCount += checkOverloaded(wh, -1);
wh.setScore(newScore);
weightedHosts.put(wh.getHost(), wh);
scores.add(wh);
sum += wh.getTScore();
overloadedCount += checkOverloaded(wh, 1);
Secondly timer tasks are not killed, so a large number of timer tasks get
started up for overloaded sites. This appears to cause some weird
behaviour.
I've put commits in that tidy up a few apparent bugs a bit but the
abovementioned behaviour remains. It seems difficult to deal with the
above in an o(1) fashion - if moving away from that, an explicit check of
each site's overload status (as implemented in the previous patches on
this thread) appears to work.
--
More information about the Swift-devel
mailing list