PHP error when releasing and archiving submissions

Bug #1557160 reported by Kristina Hoeppner on 2016-03-14
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
High
Robert Lyon

Bug Description

Reported on bug #1549947:

All of our courses (groups) are configured to archive submissions before release, so while the export_process_queue CRON task was processing about 150 collections (600 pages), PHP encountered a max_run_time error, and stopped the task partway through, so some were archived, but none were released.

The export_process_queue task locks itself when it starts and cannot be run again until it has finished, but if it crashes it does not unlock.

So for about 36 hours after this task crashed, anything that was flagged for release just said "Pending release after archiving" and nothing happened. I had to go into the config table in the database and deleted the lock, and clear out the export queue.

So this potential error will need to be handled in some way, otherwise it will probably happen a lot more often if an entire class can be flagged for archiving & release all at once. 150 collections was only 1/4 of the class.

Hi Matt. Thank you for this report. Did you have a look in Admin -> Users -> Export queue and could have restarted the export from there again?

Well now I feel a little silly, no I didn't. At that point we were panicking so my reaction was to just dive into the database. However I'm not sure if that would have fixed the problem since the CRON process probably would have stayed locked.

Trying to restart them from the admin interface may not have fixed anything, Matt. So it's good you reported it. :-)

Robert Lyon (robertl-9) on 2016-10-20
Changed in mahara:
milestone: 16.10.0 → 16.10.1
Robert Lyon (robertl-9) on 2016-10-21
Changed in mahara:
milestone: 16.10.1 → 17.04.0
Robert Lyon (robertl-9) on 2016-11-07
Changed in mahara:
status: Triaged → In Progress
Robert Lyon (robertl-9) wrote :

To test:

Set up a site and tun on 'Export to queue' option under Admin -> config site -> User settings

Then as a user do an leap2a export via Portfolio -> Export

This should add the export to the queue

Then go to Admin -> Users -> Export queue

to see it in the queue - it should be there until next cron run for it (about 5mins) make sure the cron runs and exports the item.

To replicate the problem you need to mimic the 'queue' export crashing - when it crashes it doesn't clean up the cron lock - you can do this by adding the following line to the database:

INSERT INTO config VALUES('_cron_lock_core_export_process_queue', '1');

Now do another leap2a export via Portfolio -> Export

This should stay in your export queue and when you press 're-queue' it should not actually get it processed.

Then checkout patch and hit the 're-queue' button again, this should clear the lock, and eventually the cron should export it from queue.

Reviewed: https://reviews.mahara.org/7236
Committed: https://git.mahara.org/mahara/mahara/commit/81c04a73294e2b8defbd0836997599589cd747c0
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 81c04a73294e2b8defbd0836997599589cd747c0
Author: Robert Lyon <email address hidden>
Date: Mon Nov 7 21:22:59 2016 +1300

Bug 1557160: Allow submission export re-queue clear any cron lock

Also added a couple of missing accessibility strings

behatnotneeded

Change-Id: Ia50f587ae0c46e4972086a72606796e1aa822642
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9) on 2017-03-09
Changed in mahara:
status: In Progress → Fix Committed
assignee: nobody → Robert Lyon (robertl-9)
Robert Lyon (robertl-9) on 2017-04-27
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers