[Swift-devel] Re: scheduler foo

Mihael Hategan hategan at mcs.anl.gov
Mon Jul 21 09:30:59 CDT 2008


On Mon, 2008-07-21 at 13:14 +0000, Ben Clifford wrote:
> 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.

Oh, I see. They are started multiple times for the same delay.

>  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