Anonymous Login
04-26-2018 09:30 AM

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004279SMF 2.1[SMF 3.0 "Saguaro"] Generalpublic2012-06-28 05:00
PrioritynormalSeverityminorReproducibilityhave not tried
Summary0004279: Timeouts while looping through big attachment directories
DescriptionShort 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.

Original report:
Additional InformationWill set it for the next version, though. (not 2.0)
Attached Files

related to 0004938closedarrowtotheknee SMF 2.0 attachment repair stall due to admin security 



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.


emanuele (Viewer)

Commit: 2dd55dd12e1acc0e8a2d39e6e63b79dae1122d22

* 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?


emanuele (Viewer)


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 (Viewer)

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


emanuele (Viewer)

commit a8f52e3a12dc77e69c891cac95f5fe8e3fc6fd0f
Author: Spuds
Date: Tue Apr 3 2012

    ! Attachment management overhaul from Kays hard work. Adds much improved error management of attachments and overall program flow.

commit de836631d5350f4533322ffd52198755fb8a2930
Author: emanuele
Date: Sun Apr 29 2012

    + Added scheduled task to remove temporary attachments
    ! Checking only the size of the current directory when posting

commit b0f7609215e0df3c79eea31c509d543ae49022fc
Author: emanuele
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.
MantisBT (Modified for SMF Intergration)[^] Copyright © 2000 - 2010 Mantis Group