Skip to content

Commit 27d7def

Browse files
fix(server): recently idle branches wait half an hour between pull request rereads
The recheck deadline's five-minute minimum matched GitManager's cache lifetime, so threads idle for less than an hour were still reread every five minutes by the settlement and discovery sweeps. The minimum is now thirty minutes. Fixes #35319 Co-Authored-By: Claude Fable 5.2 <[email protected]>
1 parent 7efaa84 commit 27d7def

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎apps/server/src/orchestration-v2/ThreadPullRequestService.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,10 @@ describe("ThreadPullRequestServiceV2 reads", () => {
608608
yield* Deferred.succeed(activation, undefined);
609609

610610
// Startup backfill sweep, then periodic sweeps: a branch without a pull request
611-
// is reread after five minutes, not on every sweep.
611+
// is reread after half an hour, not on every sweep.
612612
yield* Queue.take(sweeps);
613613
yield* service.drain;
614-
for (let minute = 1; minute <= 4; minute += 1) {
614+
for (let minute = 1; minute <= 29; minute += 1) {
615615
yield* TestClock.adjust("1 minute");
616616
yield* Queue.take(sweeps);
617617
yield* service.drain;

‎apps/server/src/orchestration-v2/ThreadSettlementService.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1747,7 +1747,7 @@ describe("ThreadSettlementServiceV2 worker", () => {
17471747
yield* Effect.gen(function* () {
17481748
const reactor = yield* ThreadSettlementService.ThreadSettlementServiceV2;
17491749
yield* startHarness(reactor, fixture.activation, fixture.snapshotReads);
1750-
for (let minute = 1; minute <= 4; minute += 1) {
1750+
for (let minute = 1; minute <= 29; minute += 1) {
17511751
yield* TestClock.adjust("1 minute");
17521752
yield* Queue.take(fixture.snapshotReads);
17531753
yield* reactor.drain;

‎apps/server/src/orchestration-v2/noPullRequestRechecks.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const RECHECK_MIN_MS = 5 * 60 * 1_000;
1+
const RECHECK_MIN_MS = 30 * 60 * 1_000;
22
const RECHECK_MAX_MS = 24 * 60 * 60 * 1_000;
33
const RECHECK_IDLE_DIVISOR = 12;
44

@@ -9,7 +9,7 @@ const RECHECK_IDLE_DIVISOR = 12;
99
export function makeNoPullRequestRechecks() {
1010
const readAtMs = new Map<string, number>();
1111
return {
12-
/** A thread idle for a day is reread every two hours; one idle twelve days or more, daily. */
12+
/** Reread every half hour at first, every two hours after a day idle, daily after twelve days. */
1313
waiting: (key: string, nowMs: number, activityAtMs: number): boolean => {
1414
const lastReadAtMs = readAtMs.get(key);
1515
if (lastReadAtMs === undefined) return false;

0 commit comments

Comments
 (0)