Advertisement:

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004279SMF 2.1[SMF 3.0 "Saguaro"] Generalpublic2010-04-25 14:062012-06-28 05:00
ReporterNorv 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
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:
http://www.simplemachines.org/community/index.php?topic=323042.0 [^]
Additional InformationWill set it for the next version, though. (not 2.0)
Tags2.1
Attached Files

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

-  Notes
(0012918)
Mark Rose (Beta Tester)
2010-09-09 17:48

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.
(0014431)
emanuele (Developer)
2012-02-18 18:10

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
(0014455)
AngelinaBelle (SMF Friend)
2012-02-29 11:51

Is this resolved?
(0014498)
emanuele (Developer)
2012-03-08 09:55

Almost.

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.
(0014502)
Spuds (SMF Friend)
2012-03-08 20:40

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
(0014553)
emanuele (Developer)
2012-04-29 12:18

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 1.2.8 (Modified)[^] Copyright © 2000 - 2010 Mantis Group