[rt-devel] Temporary Files
Jonathon Padfield
jpadfield at hotkey.net.au
Tue Mar 9 01:32:16 EST 2004
Firstly, I'm no expert in RT, I just got picked to look into why one of our
servers running RT was slowing down.
One of the issues is that the /tmp directory is filling up with temporary
files and directories.
I believe that the problem exists in the lib/RT/Interface/Web.pm module. The
temporary file created has no unlink associated with it, and tempfile() is
called in such a manner to prevent the file being automatically deleted on
program exit or file closure.
I've written a small patch, but would appreciate somebody who's more
experienced with the code to verify that the patch shouldn't break anything.
*** Web.pm 2003-09-26 06:31:07.000000000 +1000
--- Web.modded.pm 2004-03-09 16:05:36.000000000 +1100
***************
*** 523,529 ****
# on NFS and NTFS, it is possible that tempfile() conflicts
# with other processes, causing a race condition. we try to
# accommodate this by pausing and retrying.
! last if ($fh, $temp_file) = eval { tempfile() };
sleep 1;
}
--- 523,529 ----
# on NFS and NTFS, it is possible that tempfile() conflicts
# with other processes, causing a race condition. we try to
# accommodate this by pausing and retrying.
! last if ($fh, $temp_file) = eval { tempfile(UNLINK => 1) };
sleep 1;
}
Secondly, I searched the archives, but didn't see any mention of this
recently. Unfortunatly the server lists.bestpractical.com is listed in SPEWS
again.
Regards,
Jonathon Padfield
More information about the Rt-devel
mailing list