diff --git a/.github/workflows/sweep.yml b/.github/workflows/sweep.yml index 0554e21bf7..1da62c7740 100644 --- a/.github/workflows/sweep.yml +++ b/.github/workflows/sweep.yml @@ -3968,6 +3968,7 @@ jobs: issues: read pull-requests: read env: + CLAWSWEEPER_STATE_LEASE_ACQUIRE_TIMEOUT_MS: "900000" CLAWSWEEPER_UNCONFIRMED_PRODUCT_DIRECTION_CLOSE_ENABLED: ${{ vars.CLAWSWEEPER_UNCONFIRMED_PRODUCT_DIRECTION_CLOSE_ENABLED || 'false' }} CLAWSWEEPER_UNSPONSORED_FEATURE_CLOSE_ENABLED: ${{ vars.CLAWSWEEPER_UNSPONSORED_FEATURE_CLOSE_ENABLED || 'false' }} CLAWSWEEPER_IDEA_REVIVAL_REACTIONS: ${{ vars.CLAWSWEEPER_IDEA_REVIVAL_REACTIONS || '5' }} @@ -4183,6 +4184,8 @@ jobs: publish-apply-proof-action-ledger: name: Publish immutable apply proof action ledger + env: + CLAWSWEEPER_STATE_LEASE_ACQUIRE_TIMEOUT_MS: "900000" needs: apply-proof if: ${{ always() && needs.apply-proof.result != 'skipped' }} runs-on: ubuntu-latest @@ -4263,6 +4266,7 @@ jobs: cancel-in-progress: false queue: max env: + CLAWSWEEPER_STATE_LEASE_ACQUIRE_TIMEOUT_MS: "900000" CLAWSWEEPER_UNCONFIRMED_PRODUCT_DIRECTION_CLOSE_ENABLED: ${{ vars.CLAWSWEEPER_UNCONFIRMED_PRODUCT_DIRECTION_CLOSE_ENABLED || 'false' }} CLAWSWEEPER_UNSPONSORED_FEATURE_CLOSE_ENABLED: ${{ vars.CLAWSWEEPER_UNSPONSORED_FEATURE_CLOSE_ENABLED || 'false' }} CLAWSWEEPER_IDEA_REVIVAL_REACTIONS: ${{ vars.CLAWSWEEPER_IDEA_REVIVAL_REACTIONS || '5' }} diff --git a/src/repair/git-publish.ts b/src/repair/git-publish.ts index 5b3bc917d4..78bc1c6aff 100644 --- a/src/repair/git-publish.ts +++ b/src/repair/git-publish.ts @@ -85,7 +85,17 @@ const RECOVERY_FETCH_TIMEOUT_MS = 300_000; const STATE_PUBLISH_LEASE_REF_ROOT = "refs/heads/clawsweeper-publish-lease"; const STATE_PUBLISH_LEASE_TTL_MS = 2 * 60_000; const STATE_PUBLISH_LEASE_RENEW_THRESHOLD_MS = PUBLISH_FETCH_TIMEOUT_MS; -const STATE_PUBLISH_LEASE_ACQUIRE_TIMEOUT_MS = 3 * 60_000; +const STATE_PUBLISH_LEASE_ACQUIRE_TIMEOUT_MS = (() => { + const fallback = 3 * 60_000; + // Rare, high-value publishers (the apply lane) starve behind the review + // herd inside the default window; their workflows may raise the budget so + // one apply publish out-waits contention instead of failing the run. + const configured = Number(process.env.CLAWSWEEPER_STATE_LEASE_ACQUIRE_TIMEOUT_MS); + if (Number.isInteger(configured) && configured > fallback) { + return Math.min(configured, 30 * 60_000); + } + return fallback; +})(); const STATE_PUBLISH_LEASE_WAIT_MS = 1_000; const STATE_PUBLISH_LEASE_MAX_WAIT_MS = 5_000; const SKIP_CI_DIRECTIVE_PATTERN =