Repository navigation
feat: Hardened FileSystemTransport (v1.1.0) - #1
Merged
Merged
Conversation
…chine - Fix path/iterator breakage from d057a77 (listMessageIdsGenerator + LimitIterator) - Introduce AttemptStamp and FilesystemRetryMiddleware for temporary retries - Atomic claim via rename; .message / .message.retry.N / .processing / .processing.retry.N - Backoff, recovery, keepalive, no dual-queue leakage - Updated factory, services.php, config parameters - Version bump to 1.1.0
- PHPUnit tests for FileSystemTransport, FilesystemRetryMiddleware, AttemptStamp, Factory - GitHub Actions matrix: PHP 8.2 / 8.5 / 8.6 - phpunit.xml.dist + tests/bootstrap.php - composer.json require-dev + autoload-dev
- Add require-dev (phpunit, symfony components) - Add autoload-dev for tests - Provide minimal CoreParametersHelper stub so tests run without full Mautic core-lib
Anonymous classes must implement MiddlewareInterface for Symfony 7 StackMiddleware.
- Concurrent claim: N workers, M messages → each message claimed exactly once - Concurrent send: unique IDs, no lost/dupe files - Concurrent requeue + claim: no double-processing after retry - Workers spawned as real PHP CLI processes sharing one queue dir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardened filesystem queue transport for Mautic 7 (v1.1.0) with a Mautic-4-style retry state machine, middleware-owned temporary retries, recovery, backoff, keepalive, updated docs, and a full PHPUnit + concurrent race-condition test suite (CI on PHP 8.2 / 8.5 / 8.6).
Root cause fixed
Commit
d057a771introducedlistMessageIdsGenerator()which yielded basenames only. Downstream code treated those values as full paths → messages were not created/read under the correctvar/queue/…location.This PR replaces that design with an ID-centric claim path: ready IDs are listed, full paths are always built via helpers, and claim is a single atomic
rename().State machine
{id}.messagesend(){id}.processingtryClaim(){id}.message.retry.NrequeueWithRetry()→ Workerack(){id}.processing.retry.NtryClaim()reject()→ failed transport.processing*→ ready (same attempt)recoverStuckProcessingFiles()Guarantees:
rename(); loser getsnull)Main changes
New
Messenger/Stamp/AttemptStamp.phpMessenger/Middleware/FilesystemRetryMiddleware.phptests/Unit/…,tests/Concurrency/…).github/workflows/tests.yml)phpunit.xml.dist,tests/bootstrap.php, standaloneCoreParametersHelperstub for CIUpdated
Messenger/Transport/FileSystemTransport.php— hardened rewriteMessenger/Transport/FileSystemTransportFactory.php— cleaned (no unusedPathsHelper)Config/services.php— registers middleware + transport factoryConfig/config.php— version 1.1.0 + retry/recovery parameterscomposer.json—require-dev+autoload-devREADME.md— state machine, settings tables, testing, architectureNew config parameters