Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Nov 20, 2025

Summary by CodeRabbit

  • Chores
    • Introduced cleanup tooling for failed pending transactions
    • Adjusted concurrent transaction processing limits

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces a new TypeScript script for cleaning up failed pending transactions from Redis, processing them in configurable batches with dry-run support. Also reduces the max_inflight limit for EOA executor job handler from 100 to 20.

Changes

Cohort / File(s) Summary
New Redis cleanup script
scripts/cleanup-failed-pending-txs.ts
New script that connects to Redis, retrieves pending transactions from a sorted set, checks their statuses in batch operations, collects failed transactions, and deletes them in configurable batches with DRY RUN mode support. Includes startup diagnostics logging and comprehensive error handling.
Queue manager executor tuning
server/src/queue/manager.rs
Reduced max_inflight from 100 to 20 in EoaExecutorJobHandler initialization within QueueManager::new.

Sequence Diagram

sequenceDiagram
    participant Script
    participant Redis
    participant Pipeline
    
    Script->>Redis: Connect & validate REDIS_URL
    Script->>Redis: Get total pending txs (zcard)
    
    loop For each batch
        Script->>Redis: Fetch tx IDs (zrange with offset)
        Script->>Pipeline: Queue hget for each tx status
        Pipeline->>Redis: Execute pipeline
        Script->>Script: Aggregate statuses & collect failed txs
    end
    
    loop Delete batches (if not DRY RUN)
        Script->>Redis: zrem failed tx IDs
    end
    
    Script->>Script: Log statistics & results
    Script->>Redis: Close connection
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Redis connection handling and cleanup: Verify proper error handling and finally block ensures connection closure even on failure
  • Batch processing logic: Confirm offset-based pagination with zrange correctly processes all pending transactions without duplication or gaps
  • Status aggregation and failed transaction collection: Validate correctness of status filtering and that failed transaction identification matches intended criteria
  • DRY RUN vs. actual deletion: Ensure conditional logic between simulated logging and actual zrem operations is correct
  • Pipeline operations: Review error handling for failed pipeline executions and partial failures
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Add_script_to_clean_up_failed_pending_transactions_and_reduce_max_inflight

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c4cbaa1 and fec433e.

📒 Files selected for processing (2)
  • scripts/cleanup-failed-pending-txs.ts (1 hunks)
  • server/src/queue/manager.rs (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@joaquim-verges joaquim-verges changed the title Add script to clean up failed pending transactions and reduce max_inflight reduce max_inflight to 20 Nov 20, 2025
@joaquim-verges joaquim-verges marked this pull request as ready for review November 20, 2025 22:30
@joaquim-verges joaquim-verges merged commit 3af7dbd into main Nov 20, 2025
3 of 4 checks passed
@joaquim-verges joaquim-verges deleted the Add_script_to_clean_up_failed_pending_transactions_and_reduce_max_inflight branch November 20, 2025 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants