This module is created as an example of how to properly debug issues related with race conditions which occur when multiple processes try to save the order. This module is not considered as a perfect solution that will always work in every case. Please use with caution. Always test on a staging environment first, before moving this over to production. When using in production, please keep in mind that this module will write a lot of log lines when activated. We therefore recommend to immediately deactivate this as soon as the issue has occurred and has been properly logged.
This module will probably not give an immediate answer to your problem, but will hopefully bring you a step closer to finding the cause of it.
This module can be installed via composer:
composer require multisafepay/magento2-order-save-inspector
Alternatively, this can also be installed through downloading the zip package and unpacking the contents to the app/code/MultiSafepay/OrderSaveInspector directory
Next, enable the module:
bin/magento module:enable MultiSafepay_OrderSaveInspector
To activate the feature, go to Stores > Configuration > MultiSafepay > Order Save Inspector > Enabled and Set the value to Yes.
You can also change the maximum depth to configure how deep you want the debugger to log the backtrace. We recommend to only change this when the default value does not go far enough as logging a lot of lines can impact the performance of your store.
You can create issues on our repository. If you need any additional help or support, please contact [email protected]
We are also available on our Magento Slack channel #multisafepay-payments. Feel free to start a conversation or provide suggestions as to how we can refine our Magento 2 plugin.
Open Software License (OSL 3.0)
Special thanks to @hostep for providing us with the original source code.