Nice shutdown#63
Open
masicek wants to merge 2 commits into
Open
Conversation
added 2 commits
June 23, 2026 10:54
- Add Manager methods getTopPriorityName() and includeTopPriority() to support per-label DIE queues (e.g., 0_worker) - Update Consumer and Producer interfaces to accept optional consumerLabel parameter - Add -l/--label option to consume and reload-consumers commands - Enhance reload-consumers to send DIE per label with -l option (e.g., -l label1,label2) while maintaining backward compatibility (number of DIE messages per label/queue) - Update Producer helper signatures to match interface changes - Add comprehensive unit and integration tests for label queue naming and reload logic - Update README and CLAUDE.md with new functionality and usage guidance
- Add SHUTDOWN control message and NICE_SHUTDOWN_EXIT_CODE (100) to PhpAmqpLib producer - Implement publishShutdown() method on Producer interface for targeted graceful consumer stops - Update PhpAmqpLib consumer to recognize SHUTDOWN message and exit with code 100 instead of restarting - Add background-queue:shutdown-consumers command with same targeting as reload-consumers (number, queue, -l label) - Add comprehensive test suite including end-to-end subprocess test verifying proper exit code - Add shutdownConsumerWorker.php fixture for subprocess testing against real RabbitMQ and database - Document nice shutdown mechanism in README with supervisor configuration example (exitcodes=100, autorestart=unexpected) - Update CLAUDE.md with details on dual control messages (DIE for restart, SHUTDOWN for graceful stop) - Update all Producer implementations and test mocks to support publishShutdown method This allows supervisor-managed consumers to be gracefully stopped before server maintenance or restarts without requiring restarts, while maintaining backward compatibility with existing reload-consumers workflow.
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.
This allows supervisor-managed consumers to be gracefully stopped before server maintenance or restarts
without requiring restarts, while maintaining backward compatibility with existing reload-consumers workflow.