[CLEAN] Synthetic Benchmark PR #11326 - hotfix(backend): fix rate-limited messages blocking queue by republishing to back #1
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.
Benchmark PR Significant-Gravitas#11326
Type: Clean (correct implementation)
Original PR Title: hotfix(backend): fix rate-limited messages blocking queue by republishing to back
Original PR Description: ## Summary
Fix critical queue blocking issue where rate-limited user messages prevent other users' executions from being processed, causing the 135 late executions reported in production.
Root Cause Analysis
When a user exceeds
max_concurrent_graph_executions_per_user(25), the executor usesbasic_nack(requeue=True)which sends the message to the FRONT of the RabbitMQ queue. This creates an infinite blocking loop where:Solution Implementation
🔧 Core Changes
requeue_by_republishing(default:True) inbackend/util/settings.py_ack_message: Automatically uses republishing whenrequeue=Trueand setting enabledself.run_clientconnection instead of creating new ones🔄 Technical Implementation
Before (blocking):
After (non-blocking):
📊 Impact
requeue_by_republishing=FalseTest Plan
test_requeue_integration.pyvalidates real RabbitMQ queue orderingDeployment Strategy
This is a hotfix that can be deployed immediately:
Files Modified
backend/executor/manager.py: Enhanced_ack_messagelogic and_requeue_message_to_backmethodbackend/util/settings.py: Addedrequeue_by_republishingconfiguration fieldtest_requeue_integration.py: Integration test for queue ordering validationRelated Issues
Fixes the 135 late executions issue where messages were stuck in QUEUED state despite available executor capacity (583m/600m utilization).
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
Original PR URL: Significant-Gravitas#11326