From a854cc7a7b9dbf5f64208ee39a3eefd4d34cf607 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Wed, 12 Aug 2026 14:05:52 +0200 Subject: [PATCH] review: trim narrative comment in the create_schedule hoist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both automated reviews flagged the hoisted block's comment as narration (AGENTS.md: record constraints, once, ≤4 lines). Drop the "(validate before opening the tx)" restatement and compress the deadlock note to the single load-bearing constraint; the fork comment is unchanged. Co-Authored-By: Claude Opus 4.8 --- backend/windmill-api-schedule/src/lib.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/backend/windmill-api-schedule/src/lib.rs b/backend/windmill-api-schedule/src/lib.rs index b4e9bf269a..195a942398 100644 --- a/backend/windmill-api-schedule/src/lib.rs +++ b/backend/windmill-api-schedule/src/lib.rs @@ -260,14 +260,10 @@ async fn create_schedule( )); } - // Check schedule for error (validate before opening the tx). ScheduleType::from_str(&ns.schedule, ns.cron_version.as_deref(), true)?; - // These reads deliberately use the non-RLS `db` pool (fork-ness and - // permissioned_as resolution must be complete regardless of the caller's - // folder perms). Run them BEFORE opening the RLS transaction below: acquiring - // a second pooled connection while the tx is held self-deadlocks on a - // single-connection pool, and they don't depend on the tx. + // Keep these `db`-pool reads ABOVE user_db.begin(): a second pool checkout + // while the RLS tx is held self-deadlocks at max_connections=1. // // A git-sync/merge/create write into a fork never sets operational state: // force `enabled = false` so a cloned / synced / merged / UI-created schedule