Hacker News new | ask | show | jobs
by chime 2724 days ago
I think people get annoyed when the temp files don't get deleted after the process is complete and the files continue to accumulate forever.

I spent the better part of yesterday trying to figure out why ODBC drivers for an older version of MS Dynamics NAV would randomly cause crashes starting 5am on 12/31/2018. Looking at the queries, we noticed that only queries with ORDER BY clause failed with an error about not having enough swap space. The drive had plenty of storage so we weren't sure. Only when we looked into the Temp folder for SWP*.tmp files did we see an interesting result: 65535 file(s).

Apparently the driver created swap files in the temp folder to sort the results of ORDER BY. But sometimes it failed and left the temp files orphaned. The name of each temp file was SWP[int 1-65535].tmp. It appeared that at 5am it created the max 16-bit int swap file and from that point on, every number it tried already existed, throwing the 'not enough space' error. A simple delete fixed the issue.

The path we took to get to the solution was riddled with panic-fueled nightmares. DB corruption on the last day of the year when Finance was running their year-end reports would have been a terrible way to usher in 2019. We ran all the tools on the DB and its backups but nothing seemed to isolate the cause until we looked at the Temp folder on a whim.

Apologies for the long rant but just wanted to highlight a real-world (and still painfully sore) example of annoyance from temp files.