roadrunner-php/lock
PHP integration for the RoadRunner Lock plugin, enabling fast, lightweight distributed lock management in high-traffic apps and microservices. Acquire, release, and manage locks with optional blocking waits via a simple RPC-based API. Requires PHP 8.1+.
Architecture fit: Still purpose-built for RoadRunner's long-running worker model, and the architectural fit is now materially stronger because 1.2.0 adds first-class RoadRunner v3 support. RR v3 is the current major line, so this release moves the package from "aligned with a legacy runtime" to "aligned with the supported runtime." Two changes drive the re-evaluation:
roadrunner-php/lock → roadrunner/lock (Composer package identity change, consistent with the RoadRunner org's v3-era naming).rr.yaml schema, and worker/plugin lifecycle semantics differ between RR v2 and v3.No internal locking abstraction changes are documented, so the conceptual model (acquire/release a named lock inside a worker) is unchanged. However, the runtime contract underneath it has moved, which is where integration risk concentrates.
Integration feasibility: Feasible but no longer a no-op upgrade. This is a breaking change at the dependency-management layer, and potentially at the configuration layer:
composer require roadrunner/lock; the old package name should be treated as superseded. Existing composer.json constraints on roadrunner-php/lock will not resolve to 1.2.0.Technical risk: Medium (upgraded from Low). Justification:
Key questions:
roadrunner/lock 1.2.0 retain RR v2 compatibility, or does it require RR v3 (i.e., is this a hard cutoff)? What is the exact supported version matrix (package × RoadRunner × PHP × Laravel)?RoadRunnerLock\... vs. RoadRunner\Lock\...) or only the Composer package name? This determines whether use statements must be rewritten.roadrunner-php/lock receive a final release with a replace/provide alias, or must every consumer update composer.json manually?rr.yaml lock plugin schema in v3 (driver keys, Redis config, DSN format) that invalidate the configuration snippet currently in our runbook?Stack fit: Compatible with the Laravel/PHP stack, contingent on RoadRunner being present and on which RR major version. Fit is now version-sensitive rather than unconditional: the package is aligned to RR v3, and Laravel-side integration remains via the service container / a service provider. PHP and Laravel minimum versions should be re-verified against 1.2.0's composer.json — do not assume the prior Laravel 8.x–10.x / PHP 8.0+ statement still holds, since RR v3-era tooling typically raises the PHP floor.
Migration path:
composer.json so an unattended composer update cannot pull 1.2.0 into an RR v2 environment. Track the RR v3 migration as its own work item.rr.yaml to the v3 schema, then the package:
composer.json: remove roadrunner-php/lock, add roadrunner/lock at ^1.2.use statements only if the namespace changed (confirm via key question 2).lock plugin block in rr.yaml against the v3 schema and driver options.roadrunner/lock + RR v3; there is no reason to onboard onto the superseded combination.roadrunner-php/lock in composer.json files, Dockerfiles, CI configs, runbooks, and internal wikis, and update in one sweep.Compatibility: Backward compatible at the lock API level, breaking at the packaging level, and conditionally breaking at the runtime level. Treat RR v2 → v3 as a platform upgrade with its own test plan, not as a dependency bump. The prior claim of Laravel 8.x–10.x / PHP 8.0+ compatibility must be re-validated, not carried forward.
Sequencing:
composer.json + CI config) and record it in the internal dependency policy.rr.yaml v3 schema + roadrunner/lock), including lock-contention and orphan-lock scenarios.rr.yaml lock snippet and the updated package name in the runbook before wider rollout.Maintenance: Slightly increased near-term, lower long-term. Near-term work is administrative (constraint updates, package-name sweep, config revalidation). Long-term, being on RR v3 keeps the package on a supported runtime line, which reduces the risk of running an unmaintained combination. Expect a one-time bump in dependency-review load while the v2/v3 split exists, since two supported configurations must be tracked.
Support: Neutral to slightly negative in the short term, then improved. The rename is a predictable source of confusion — support requests referencing "which package do I install?" and copy-pasted v2 rr.yaml snippets on v3 runtimes should be anticipated. Mitigate by publishing an internal one-page migration note and updating the existing runbook snippet; do not rely on upstream docs alone for the config delta.
Scaling: No change to the scaling model. Lock performance remains a function of the backend driver (Redis/filesystem) and RoadRunner's stability, not of the package. Scaling review is unchanged, with one caveat: any RR v3 performance/tuning differences (worker pool sizing, plugin restart behavior) should be validated once in the pilot rather than assumed equivalent to v2.
Failure modes:
rr.yaml lock block. Symptom is plugin initialization failure or silent lock misbehavior. Mitigation: explicit composer constraints plus a startup assertion in staging.roadrunner-php/lock. Mitigation: repository-wide grep; check for replace aliasing upstream.use statements were not updated. Mitigation: confirm before pilot; static analysis in CI will catch it.Ramp-up:
use RoadRunner\Lock\Lock; // confirm namespace against 1.2.0
$lock = app(Lock::class);
$lock->acquire('job:process_order_123');
try {
// Critical section
} finally {
$lock->release('job:process_order_123');
}
If the namespace did change, that is a mechanical but repo-wide edit; scope it as a small chore, not a feature.rr.yaml schema changed, so the existing lock plugin block must be re-derived from v3 docs rather than copied. Budget a half-day for one engineer to validate drivers (Redis), credentials handling, and lock behavior under worker restart, then templatize the validated snippet for the remaining services.Recommendation: Treat 1.2.0 as a platform-alignment release, not a patch. Approve adoption only as part of an explicit RoadRunner v3 migration, and immediately constrain all RR v2 services to the last v2-compatible release to prevent uncontrolled adoption via routine dependency updates.
How can I help you explore Laravel packages today?