CIVIPLMMSR-655: Lower default reconcile batch_size from 100 to 30#27
CIVIPLMMSR-655: Lower default reconcile batch_size from 100 to 30#27erawat wants to merge 1 commit into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request adjusts the default batch size for the payment reconciliation cron job to improve reliability when processing large backlogs. By lowering the limit, the job is less likely to trigger API rate limits with providers like GoCardless, ensuring more consistent progress during automated reconciliation runs. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the default batch_size parameter from 100 to 30 in the managed job configuration for PaymentAttemptReconcile. The reviewer points out that the underlying API PaymentAttemptReconcile.Run still defaults to 100 in its implementation and API spec, and recommends updating the default value there as well to prevent inconsistency.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| 'api_action' => 'Run', | ||
| 'api_version' => 3, | ||
| 'parameters' => "processor_parameters=[Stripe Connect,2],[GoCardless,6]\nbatch_size=100\nmax_retry_count=3", | ||
| 'parameters' => "processor_parameters=[Stripe Connect,2],[GoCardless,6]\nbatch_size=30\nmax_retry_count=3", |
There was a problem hiding this comment.
WARNING: While updating the default batch_size to 30 in the managed job parameters is correct, the underlying API PaymentAttemptReconcile.Run still defaults to 100 in both its implementation (api/v3/PaymentAttemptReconcile/Run.php line 34) and its API spec (_civicrm_api3_payment_attempt_reconcile_Run_spec line 106).
To prevent inconsistency and ensure that manual API calls or other invocations also benefit from this safer default, please update the default value in the API file as well.
|
Closing in favour of compucorp/io.compuco.gocardless#204 (cache payout items in PayoutService). The rate-limit pressure that drove this PR turned out to be caused by |
Overview
Lower the default
batch_sizefor the "Reconcile stuck payment attempts" cron job from 100 to 30, to avoid hitting the GoCardless API rate limit when draining a large backlog.Before
Default
batch_size=100. On a backlog drain (one production site with ~1,500 stuck contributions), a single cron run reconciled only ~54 contributions before GoCardless's API throttle kicked in, leaving the remaining ~42 attempts erroring with "Rate limit exceeded". Errored attempts are retried next run, but the same throttle is hit again, so net progress per run is capped at ~54%.After
Default
batch_size=30. Empirically 30 reconcile attempts comfortably fit under the GoCardless per-token throttle on the same site. Net progress per run is closer to 100% with the smaller batch size.Sites needing more throughput can still raise
batch_sizeper-site via the cron Job UI (orcivicrm_job.parameters).Technical Details
managed/Job_PaymentAttemptReconcile.mgd.php— two changes:batch_size=100→batch_size=30in theparametersstring.batch_sizeupdated to reflect the new default.Core overrides
None.
Comments
Linked ticket: https://compucorp.atlassian.net/browse/CIVIPLMMSR-655
On next
cv upgrade:db -n, existing installs with the old default will be reset to 30 (Civi's default managed-entity update behaviour).