swoole-bundle/resetter-bundle
Resetter bundle for Swoole Bundle that clears Symfony service and container state between requests in long-running workers, preventing state from leaking across requests so applications stay consistent under Swoole.
DB::purge() / Redis reconnect logic per service. Given its immaturity (3 stars, 0 dependents), the realistic decision is "buy, vendor, and own" rather than "adopt as a supported dependency." Release 2.1.1 is a positive maintenance signal but does not change the adoption tier.ResetInterface semantics), this bundle becomes a reference implementation the platform team can mandate for new consumers.DB::purge / Redis::purge listeners. For most Laravel shops, the native Octane listeners are the lower-risk default and this package is a reference, not a dependency.Consider it when:
ResetInterface-style reset semantics and want resetters that plug into that contract.Look elsewhere when:
2.1.x prior to that release carried a real correctness bug.Release note (2.1.1): fix(dbal): discard every level of a leftover transaction, and close a connection that cannot be rolled back. Patch-level, no new APIs, no deprecations — but it is a behavioral change on the failure path (the DBAL resetter now closes an unrollbackable connection rather than passing it back). Pin the floor at >=2.1.1, re-vendor on bump, and re-run your stale-connection integration tests. Verify that application code does not cache a PDO/PHP-DBAL connection object across the reset boundary, since that handle may now be closed.
For executives: This is small, cheap insurance against a known production failure mode — stale database and cache connections in long-running PHP workers. The 2.1.1 patch is evidence the failure mode is genuine and actively maintained: it fixes incomplete cleanup of leftover nested transactions and forces closure of connections that can no longer be safely rolled back. It is MIT-licensed and narrow in scope, so cost of trial is low. The caveat remains maturity: with minimal adoption, it should be piloted behind a feature flag and treated as code we own, not a supported vendor dependency. Approve a time-boxed pilot, not a platform commitment, and require a pinned version at 2.1.1 or later.
For engineering: A Symfony bundle providing connection resetters intended to run between jobs/requests in Swoole workers and message consumers. Integration path: add the package, register the bundle/resetters at the worker boundary (after each job or request), and confirm coverage for the clients you actually use (PDO, Redis, etc.). Because it is Symfony-native, Laravel adoption requires a thin bridge — or, more pragmatically, mirroring the approach using Octane's existing purge listeners. 2.1.1 fixed a subtle defect worth understanding before you trust it: the DBAL resetter previously unwound only the outermost leftover transaction level, so a connection with nested/partial transaction state could be handed back to the pool still dirty; it now discards every level and, if rollback fails outright, closes the connection so a fresh one is established. Treat that as the baseline contract your tests should assert, not as a bonus. Mitigations: pin >=2.1.1, vendor or fork the resetters, add regression tests that simulate (a) a stale connection, (b) a nested uncommitted transaction at job end, and (c) an unrollbackable connection, and keep a manual DB::purge() / Redis reconnect fallback. Success metrics: connection-related errors per 10k jobs, worker memory growth, and worker restart frequency. Do not adopt without a named owner.
How can I help you explore Laravel packages today?