- Issue created by @berdir
- Status changed to Needs review
10 months ago 1:32pm 30 January 2024
Many hosting environments have a fairly low limit of concurrent requests, the sleep(20) in can, combined with a few concurrent payment processes or maybe some bulk updates in Wallee block all those processes and essentially cause a denial of service issue.
I understand it's there to prevent race conditions, but the loadForUpdate() in \Drupal\commerce_wallee\Services\PaymentSdk::webhookTransaction() should help with that. A different option, if this update isn't time sensitive, would be to use a queue to process them, unless you have a continuously running queue processing system, it will be processed on the next cron run.
As a quickfix, I'm uploading a patch to remove that line. We didn't have race conditions on Wallee in a previous version, unlike some other payment gateways.
I don't expect that this will be committed as is as you probably added that for a reason. but maybe it predates the loadForUpdate() change? happy to discuss to find a better solution.
Needs review
2.0
Code