Skip to content

Releases: Ahed92Wakim/laravel-db-transaction-retry

Simplifies retry configuration for deadlocks and timeouts

14 Nov 11:02
33806a9

Choose a tag to compare

  • Breaking – Removed the retryable_exceptions config array entirely; deadlock (40001 / 1213) and lock-wait timeout (1205) retries are now controlled solely by the retry_on_deadlock and retry_on_lock_wait_timeout booleans. Any previously published config that referenced retryable_exceptions.* must be updated.

  • Behavioral – The retrier now retries based on those toggles only, automatically handling SQLSTATE-only deadlocks and lock-wait driver codes without extra config.

  • Behavioral – The lock-wait timeout override still runs only when retry_on_lock_wait_timeout is enabled, ensuring session statements remain opt-in.

  • Docs/Tests – README rewritten to match the streamlined options, and the Pest suite updated to cover the new retry rules and edge cases.

Adds runtime toggle to enable/disable retries

02 Nov 16:35
cfef3ff

Choose a tag to compare

Introduces Artisan commands to enable/disable database transaction retries at runtime without modifying configuration files. This is achieved by creating/removing a marker file.

Adds RetryToggle class to handle the logic for checking and managing the marker file.

Updates the transaction retrier to respect the runtime toggle status.

v2.0.0 – Configurable Deadlock Retrier & Logging Overhaul

20 Oct 18:03
96ee0ca

Choose a tag to compare

Breaking

  • Replaced DBTransactionRetryHelper::transactionWithRetry() with the new MysqlDeadlocks\RetryHelper\Services\DeadlockTransactionRetrier::runWithRetry(). Update imports/usages accordingly.
  • Package config now lives under config/mysql-deadlock-retry.php; publish it with php artisan vendor:publish --tag=mysql-deadlock-retry-config if you rely on defaults.

Highlights

  • Added first-class configuration for retry counts, base delay, and log file naming, all overridable via env vars.
  • Introduced DeadlockTransactionRetrier service with exponential backoff, jitter, request-aware logging context, and container-exposed transaction labels.
  • Delivered dedicated helpers (DeadlockLogWriter, TraceFormatter, BindingStringifier) for consistent instrumentation and easier extension.
  • Updated README with usage samples, configuration guidance, and package badges.

Maintenance

  • Switched the test suite to Pest and broadened coverage for retry scenarios, logging behaviour, and jitter math.
  • Refreshed GitHub Actions workflow, coding standards config, and development dependencies.

What's Changed

New Contributors

Full Changelog: 1.3.1...2.0.0

Don't log the none deadlock exception just throw it

11 Oct 17:20

Choose a tag to compare

Improves DB transaction retry logic

do not log if non deadlock exception just throw it

improve logs

03 Oct 11:02

Choose a tag to compare

1.2.3

improve log

fix log-directory

03 Oct 10:02

Choose a tag to compare

1.2.1

Merge branch 'hotfix/fix-log'

improve retry logic

03 Sep 13:20

Choose a tag to compare

Updates dependencies and improves retry logic

- Updates composer dependencies to newer versions, including Laravel 12 and PHP 8.2
- Refactors retry logic to include exponential backoff with jitter for more robust handling of deadlocks
- Improves logging context with request details (URL, method, token, userId) when available, and includes full exception traces for debugging
- Enhance logic to identify retryable deadlock/serialization failure errors