Repository navigation
Serialize Mergify queue requests in a task worktree #1346
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -327,7 +327,11 @@ def markers(repo: str, number: int, head: str, queue: str) -> tuple[bool, bool]: | |
|
|
||
| def request(repo: str, number: int, head: str, queue: str) -> None: | ||
| body = f"@mergifyio queue\n\n{_marker(REQUEST, head, queue)}" # Mergify deprecates naming the queue | ||
| github._api(f"repos/{repo}/issues/{number}/comments", {"body": body}) | ||
| try: | ||
| github._api(f"repos/{repo}/issues/{number}/comments", {"body": body}) | ||
| except (github.GhError, github.ProcTimeout, OSError): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: A lost-reply re-read still allows a duplicate request if the comment shows up late After |
||
| if not markers(repo, number, head, queue)[0]: | ||
| raise | ||
|
|
||
|
|
||
| def mark_confirmed(repo: str, number: int, head: str, queue: str) -> None: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Admission lock waits with no bound and ignores the --wait budget
_lock_task_statecalls a blockingflock(LOCK_EX). A secondmerge --wait Nstays blocked for as long as the first invocation takes in its admission network calls:markers,membership,merged_sha,mark_confirmedandrequest, each with its own gh timeout. The second invocation only checksadmit_byafter it gets the lock. These calls have timeouts, so the wait is bounded in practice and the admission check still runs. However, the time spent waiting for the lock can use up most of the--waitbudget without any message to the user. This is a non-blocking note. If it matters, you could print a line when the lock is contended, or useLOCK_NBin a poll loop bounded byadmit_by.