Repository navigation
fix(delayed-job): 8h grab_for for PushClassGrades - #58
Merged
Merged
Conversation
A whole-class grade push makes one AGS request per student per linked assignment, so on a very large course it can outlive the 2 hour DelayedJob::Worker default grab_for, after which another worker starts a second copy of a push that is still running. GetClassMembership already overrides grab_for to 8 hours for the same reason (a 5,100-student course took ~4 hours); UBC's largest course is 6,518 students with 56 links. TheSchwartz reads grab_for from the worker class, so this applies to all class pushes. Overridable with DELAYED_JOB_CLASS_GRADES_GRAB_FOR, like DELAYED_JOB_NRPS_GRAB_FOR. PushUserGrades keeps 2 hours.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
DelayedJob::PushClassGradesinherits the 2-hourgrab_forfromDelayedJob::Worker. A whole-class push makes one AGS request per student per linked assignment, so on a very large course it can run longer than that. TheSchwartz then treats it as failed, and another worker starts a second copy while the first is still running.GetClassMembershipalready overridesgrab_forto 8 hours for exactly this reason (per its comment, a 5,100-student course took about 4 hours). UBC's largest course is 6,518 students with 56 linked assignments.Change
PushClassGrades::grab_forreturns$ENV{DELAYED_JOB_CLASS_GRADES_GRAB_FOR} // 8h, mirroringGetClassMembershipandDELAYED_JOB_NRPS_GRAB_FOR.grab_forfrom the worker class when grabbing ($worker_class->grab_for, TheSchwartz.pm:420), so it can't vary per course or job.PushUserGrades(per-student, on submission) keeps its 2 h.karpenter.sh/do-not-disrupt(chart 0.3.17), so node consolidation no longer kills workers mid-job.Verification
Loaded in the WeBWorK image (webwork-verf worker pod, patched file ahead of the installed one):
perltidy20240903 with.perltidyrc: no changes.