Skip to content

Comments

Use advisory lock to prevent concurrent processing of the same review request#5718

Open
suhaibmujahid wants to merge 2 commits intomozilla:masterfrom
suhaibmujahid:duplicate-avoidance
Open

Use advisory lock to prevent concurrent processing of the same review request#5718
suhaibmujahid wants to merge 2 commits intomozilla:masterfrom
suhaibmujahid:duplicate-avoidance

Conversation

@suhaibmujahid
Copy link
Member

@suhaibmujahid suhaibmujahid commented Feb 21, 2026

Fixes #5716

Remove task_id from review requests now that advisory lock prevents duplicates. The advisory lock mechanism makes the task_id-based deduplication unnecessary.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #5716 by implementing recovery backoff and duplicate-avoidance mechanisms to prevent the Review Helper from processing the same diff multiple times and posting duplicate comments. The changes add timeout handling for Cloud Tasks, recovery logic for stuck processing states, and detection of concurrent processing attempts.

Changes:

  • Added a 30-minute dispatch deadline for Cloud Tasks to prevent indefinite task execution
  • Implemented recovery backoff logic that delays retries when a review request is stuck in PROCESSING state
  • Added duplicate-avoidance by detecting when the client disconnects and another task has taken over processing
  • Improved error handling to properly reset status on transient errors

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
services/reviewhelper-api/app/tasks.py Added dispatch_deadline of 30 minutes to Cloud Tasks configuration
services/reviewhelper-api/app/routers/internal.py Implemented recovery backoff logic, duplicate-avoidance via disconnection detection, and improved error handling
services/reviewhelper-api/app/review_processor.py Modified to return tuple of (comments, summary, details) instead of modifying review_request directly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@suhaibmujahid suhaibmujahid changed the title Add recovery backoff and duplicate-avoidance Use advisory lock to prevent concurrent processing of the same review request Feb 21, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

… request

Remove task_id from review requests now that advisory lock prevents duplicates. The advisory lock mechanism makes the task_id-based deduplication unnecessary.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Review helper processes the same diff multiple times and creates duplicate comments

1 participant