mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #02239
[Bug 685633] Re: export_cleanup_old_exports cron causes exception and long-running cron if export directory doesn't exist
Check whether the directory exists before instantiating the
DirectoryIterator.
I considered using check_dir_exists, which would create the directory
and then allow the cron to be run, but felt that the cron probably
wasn't the best place to create the directory -- it's a little counter
intuitive to create the directory in the cleanup cron. As a result, I've
opted for checking that the directory exists, and if it doesn't,
returning from the function at that point.
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
https://bugs.launchpad.net/bugs/685633
Title:
export_cleanup_old_exports cron causes exception and long-running cron if export directory doesn't exist
Status in Mahara ePortfolio:
Fix Committed
Bug description:
If export directory doesn't exist (e.g. because no exports have been run), then the cron goes bang.
When the cron goes bang, the lock isn't removed and so the cron can't be run again until the lock expires.
Master on postgres.
Trace follows:
[Sun Dec 05 21:13:32 2010] [error] [client 192.168.254.230] [DBG] 3e (lib/cron.php:146) Running core cron export_cleanup_old_exports
[Sun Dec 05 21:13:32 2010] [error] [client 192.168.254.230] [WAR] 3e (export/lib.php:377) DirectoryIterator::__construct(/var/cache/mahara/uploaddir/export/) [directoryiterator.--construct]: failed to open dir: No such file or directory
[Sun Dec 05 21:13:32 2010] [error] [client 192.168.254.230] Call stack (most recent first):
[Sun Dec 05 21:13:32 2010] [error] [client 192.168.254.230] * log_message("DirectoryIterator::__construct(/var/cache/mahara/u...", 8, true, true, "/home/nicols/mahara/htdocs/export/lib.php", 377) at /home/nicols/mahara/htdocs/lib/errors.php:444
[Sun Dec 05 21:13:32 2010] [error] [client 192.168.254.230] * error(2, "DirectoryIterator::__construct(/var/cache/mahara/u...", "/home/nicols/mahara/htdocs/export/lib.php", 377, array(size 1)) at Unknown:0
[Sun Dec 05 21:13:32 2010] [error] [client 192.168.254.230] * DirectoryIterator->__construct("/var/cache/mahara/uploaddir/export/") at /home/nicols/mahara/htdocs/export/lib.php:377
[Sun Dec 05 21:13:32 2010] [error] [client 192.168.254.230] * export_cleanup_old_exports() at /home/nicols/mahara/htdocs/lib/cron.php:149
[Sun Dec 05 21:13:32 2010] [error] [client 192.168.254.230]
References