forked from Significant-Gravitas/AutoGPT
-
Notifications
You must be signed in to change notification settings - Fork 5
[CORRUPTED] Synthetic Benchmark PR #11008 - fix(backend): prevent duplicate graph executions across multiple executor pods #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ofir-frd
wants to merge
8
commits into
base_pr_11008_20251215_4458
Choose a base branch
from
corrupted_pr_11008_20251215_4458
base: base_pr_11008_20251215_4458
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
## Summary Add complete integration test suite for ClusterLock in synchronize_test.py covering all aspects of Redis-based distributed locking. ## Test Coverage (27 tests across 7 categories) ### Basic Functionality - Lock acquisition success/failure - Lock contention handling - Release behavior (confirms flag-only approach is correct) ### Lock Refresh & TTL Management - TTL extension and rate limiting (timeout/10 with 10s minimum) - Ownership verification during refresh - Natural expiry via Redis TTL ### Context Manager Support - Blocking/non-blocking acquisition modes - Automatic cleanup after context exit - Proper exception handling ### Concurrency & Thread Safety - Multiple threads competing for same lock - Sequential lock reuse after expiry - Refresh during concurrent access attempts ### Error Handling & Edge Cases - Redis connection failures handled gracefully - Parameter validation (empty keys, invalid timeouts) - Manual key deletion scenarios ### Real-World Scenarios - Graph execution coordination simulation (mirrors ExecutionManager usage) - Long-running execution with periodic refresh - Graceful degradation when Redis becomes unavailable ## Technical Details - Uses same Redis configuration as backend (HOST, PORT, PASSWORD from .env) - decode_responses=False for ClusterLock's raw bytes ownership verification - No mocking - tests against real Redis for authentic distributed behavior - Validates dynamic refresh interval calculation: max(timeout // 10, 10) ## Validation - All 27 tests pass ✅ - Confirms release() strategy of just setting flags is correct - Real integration with existing ExecutionManager infrastructure - Thread-safe cluster coordination verified 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…rehensive tests Move ClusterLock from utils to executor folder where it belongs logically. Add comprehensive integration tests and improve Redis compatibility. Fixes duplicate node execution issues by providing proper distributed locking. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fix failing store tests by adding the missing is_available field to StoreAgent test fixtures. The prisma.models.StoreAgent requires this field which was recently added but tests weren't updated. Also fix graceful degradation test timing by using shorter timeout and longer wait. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
… hotfix/duplicate-node-execution
…s for clearer ownership checking Summary: Change try_acquire() return semantics to make ownership checking more intuitive. Changes Made: - Returns self.owner_id when successfully acquired (instead of None) - Returns different owner_id when someone else holds the lock - Returns None only when Redis is unavailable or connection fails - Updated manager.py to use new check: current_owner != self.executor_id - Updated all 21 test cases to expect new return values Benefits: More intuitive success checking, clearer ownership visibility, eliminates confusing None-means-success pattern. Validation: All 1061 backend tests pass with 0 failures. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Dec 29, 2025
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.
Benchmark PR Significant-Gravitas#11008
Type: Corrupted (contains bugs)
Original PR Title: fix(backend): prevent duplicate graph executions across multiple executor pods
Original PR Description: ## Problem
Multiple executor pods could simultaneously execute the same graph, leading to:
Solution
Implement distributed locking using ClusterLock to ensure only one executor pod can process a specific graph execution at a time.
Key Changes
Core Fix: Distributed Execution Coordination
Technical Implementation
backend/executor/alongside ExecutionManager (its primary consumer)Reliability Improvements
Test Coverage
Impact
Validation
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
Original PR URL: Significant-Gravitas#11008
Compliance Violation