Simple Machines Bug and Feature Tracker
|Anonymous | Login||04-24-2014 09:33 AM|
|My View | View Issues|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004279||SMF 2.1||[SMF 3.0 "Saguaro"] General||public||2010-04-25 14:06||2012-06-28 05:00|
|Priority||normal||Severity||minor||Reproducibility||have not tried|
|Summary||0004279: Timeouts while looping through big attachment directories|
|Description||Short summary: for big attachment directories (12,000 files and more), when SMF loops through the directory to count the attachment dir size, timeouts may result.|
=> internal server error
Note that the original report was on 1.1.x. Though it still applies to 2.0, having the possibility to define multiple attachment directories by default may help here.
I am tracking this rather because I wonder if we can improve, in 2.x, this whole implementation of the check: ManageAttachments.php 606 - 628.
|Additional Information||Will set it for the next version, though. (not 2.0)|
MantisBT 1.2.8 (Modified)[^] Copyright © 2000 - 2010 Mantis Group
Mark Rose (Beta Tester)
A good solution to this would be to:
1. Track the size of attachments in the attachment table. But an index on that column to make a SUM(col) quick.
2. Run the cleaning task in cron.
* Use the db instead of filesize during post to determine if the directory is full or not. From [Bug 4279] and Spuds's idea
AngelinaBelle (SMF Friend)
|Is this resolved?|
In the post page the loop has been removed.
The check for temporary files is now in a scheduled task.
We still have to decide what's the best approach for the scheduled task.
Two are the possibilities: a loop like the one used up to now, or the function glob to get all the existing temp files and delete them.
Spuds (SMF Friend)
The safe thing to do is just use the old tried and true code that we have been using, just move it to a scheduled task.
Although I don't immediately see anything wrong with using glob, I'm not sure we want to spend any time debug on that, plus we simply will not get the system coverage that is needed to truly test it out for 2.1 without an extended set of beta's rc's etc
Date: Tue Apr 3 2012
! Attachment management overhaul from Kays hard work. Adds much improved error management of attachments and overall program flow.
Date: Sun Apr 29 2012
+ Added scheduled task to remove temporary attachments
! Checking only the size of the current directory when posting
Date: Sun Apr 29 2012
! removal of temporary attachments moved from the main maintenance page to the real maintenance task and split in steps...I hope - related to [Bug 4279]
With these changes the issue should be solved.