On Tue, Dec 11, 2001 at 10:47:44PM -0500, Glenn Maynard wrote:
> > This is done for background jobs to delay the connection usage to avoid
> > excessive ABOR's. E.g. if you do two commands quickly, then background
> > job can start its own data transfer between them and it will be
> > aborted immediately:
> >    get file &
> >    ls; cd ..
> >
> > With this code background session delays for 1 second before actually
> > using the connection.
> 
> Okay, I understand this better now.  A suggestion: instead of delaying
> the job for a second, make it wait until the session has been idle for a
> second.  That way, "get file &" starts immediately (since nothing has been
> happening on the session.)  This doesn't help the case where there's
> other priority levels in use (would be useful to have an intelligent
> antiidle job on idle priority -1), but nothing does that yet.
> 
> idle_time could use being changed to a Time; currently, rounding error
> can make the delay up to 2 seconds.  (I'd suggest a lower number, too;
> maybe 500ms.)

ftpclass.cc:1041
   if(now < o->idle_start+1)
to
   if(priority <= 0 && now < o->idle_start+1)

If we knew the priority of the job the last used the session, we could
do:

   if(priority < o->priority && now < o->idle_start+1)
   
but Reuse() resets it to 0.  (This would make it delay only when it was
used by a higher pri job, which should prevent fighting for the session
without a lot of extra delays.)

-- 
Glenn Maynard

Reply via email to