Comment 21 for bug 2060534

Revision history for this message
In , Omry Yadan (omry) wrote :

Thanks Anje,

> If the compacting process is terminated by eg: exiting Thunderbird then it will create and leave the nstmp file - not delete it. Hence why you should not interupt the compacting process.

I would call this is a bug.
1. The tmp file should not be left there on orderly exit. (e.g. not kill -9 or a power outage).
2. The tmp file should probably be cleaned up on startup.

> You see nstmp because the compacting process was interupted or could not complete for some reason. Maybe the Sent file was corrupted or contained a corrupted email.

Everything is possible of course.
As a user I find it hard to debug though. I have 26k mails in my Sent items.
Whatever corruption causes it to grow from 1.5GB to 50GB, it happened at least twice.

> In topicbox beta forum there has been a report of large nstmp file. The compacting process was not able to complete hence nstmp file of enormouse size.

Can you point to that message?
I did not read the code of the compacting process, but I would guess it's simply iterating on the messages and writing each non-deleted message to nstmp, and then swaping nstmp with the flat file.
If this is the case, the only situation where the compacting process would get stuck is if the iteration on the mails in the folder is infinite.
It should be possible to detect such a case (simply by observing that we iterated more emails than exist in the folder) and automatically repair the folder by redownloading it from the server.

> Users reporting the issue did have some emails that were missing headers and garbled text.
After deleting those 'bad' messages, the compacting process worked ok.

Any help in detecting such 'bad' messages would be appreciated.