[Dovecot] bogus fts percentage

William Blunn bill+dovecot at blunn.org
Thu Sep 2 17:03:40 EEST 2010


On 01/09/2010 20:35, Timo Sirainen wrote:
> On Mon, 2010-08-30 at 12:54 -0500, Mike Abbott wrote:
>    
>> Sometimes dovecot-2.0 sends this untagged response to clients:
>> * OK Indexed -2147483648% of the mailbox, ETA 0:00
>>
>> I imagine there's a bug in there somewhere.
>>      
> Well, I guess this fixes it:
> http://hg.dovecot.org/dovecot-2.0/rev/1012052e2e85
>    

Inspection of code reveals a bug in this change.

This bit:

     1.22 -        secs = (msecs / (percentage / 100.0) - msecs) / 1000;
     1.23 +        secs = (msecs*percentage / 100 - msecs) / 1000;

changes the calculation from

     estimated_total_time = elapsed_time ÷ completed_fraction

which seems to be correct, to

     estimated_total_time = elapsed_time × completed_fraction

which seems to be incorrect.

(I have written a fix and sent the diff to Timo.)

Bill


More information about the dovecot mailing list