Skip to content

Commit 1030ae1

Browse files
committed
Remove merge queue lock
1 parent 0d4f37c commit 1030ae1

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/bors/merge_queue.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use anyhow::anyhow;
22
use octocrab::params::checks::{CheckRunConclusion, CheckRunStatus};
3-
use std::sync::{Arc, OnceLock};
4-
use tokio::sync::Mutex;
3+
use std::sync::Arc;
54

65
use crate::{
76
BorsContext,
@@ -14,7 +13,10 @@ use crate::{
1413
handlers::labels::handle_label_trigger,
1514
},
1615
database::{BuildStatus, MergeableState, PullRequestModel},
17-
github::{CommitSha, LabelTrigger, MergeError, api::client::GithubRepositoryClient, api::operations::ForcePush},
16+
github::{
17+
CommitSha, LabelTrigger, MergeError, api::client::GithubRepositoryClient,
18+
api::operations::ForcePush,
19+
},
1820
utils::sort_queue::sort_queue_prs,
1921
};
2022

@@ -26,8 +28,6 @@ pub(super) const AUTO_MERGE_BRANCH_NAME: &str = "automation/bors/auto-merge";
2628
/// This branch should run CI checks.
2729
pub(super) const AUTO_BRANCH_NAME: &str = "automation/bors/auto";
2830

29-
static MERGE_QUEUE_LOCK: OnceLock<Mutex<()>> = OnceLock::new();
30-
3131
pub type MergeQueueEvent = ();
3232

3333
enum MergeResult {
@@ -36,10 +36,6 @@ enum MergeResult {
3636
}
3737

3838
pub async fn handle_merge_queue(ctx: Arc<BorsContext>) -> anyhow::Result<()> {
39-
// Prevent concurrent merge queue processing.
40-
let lock = MERGE_QUEUE_LOCK.get_or_init(|| Mutex::new(()));
41-
let _guard = lock.lock().await;
42-
4339
let repos: Vec<Arc<RepositoryState>> =
4440
ctx.repositories.read().unwrap().values().cloned().collect();
4541

src/github/api/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::bors::{CheckSuite, CheckSuiteStatus, Comment};
99
use crate::config::{CONFIG_FILE_PATH, RepositoryConfig};
1010
use crate::database::RunId;
1111
use crate::github::api::base_github_html_url;
12-
use crate::github::api::operations::{MergeError, merge_branches, set_branch_to_commit, ForcePush};
12+
use crate::github::api::operations::{ForcePush, MergeError, merge_branches, set_branch_to_commit};
1313
use crate::github::{CommitSha, GithubRepoName, PullRequest, PullRequestNumber};
1414
use crate::utils::timing::{measure_network_request, perform_network_request_with_retry};
1515
use futures::TryStreamExt;

0 commit comments

Comments
 (0)