Hardcoded sleep on webhook callback blocks processes

Created on 30 January 2024, 10 months ago

Problem/Motivation

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.

Steps to reproduce

Proposed resolution

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.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇨🇭Switzerland berdir Switzerland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024