ReassignMentees reassigns the user to another mentor if possible. If not possible, the mentor/mentee relationship is dropped. To support mentors with a lot of mentees, the workload can be split into multiple jobs, with one job handling up to GEMentorshipReassignMenteesBatchSize mentees. This is implemented by having a counter incremented for each mentor; if the batch size is reached, the job stops and a new one is scheduled.
Currently, ReassignMentees does this:
- First, we try to assign if a new mentor is available.
- If not, we drop the relationship and continue with the next mentee.
- Otherwise, we increment the counter.
- The mentee is reassigned to someone else and we continue with the next mentee.
This means the counter is never incremented for mentee whose relationship is dropped. Note the testWithMenteesOverLimit test added in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/1243136 should be adjusted once we fix this (see the FIXME there).