Skip to content

Commit 3ae7e35

Browse files
nicktrnTrigger.dev RepoOps
authored andcommitted
chore: remove dead maxRunCount dequeue knob
Remove the dead `maxRunCount` dequeue option (`TRIGGER_DEQUEUE_MAX_RUN_COUNT`) from the supervisor, the worker dequeue request schema, the self-hosting docs and the Helm chart. Server-side dequeue batching was removed in #2127 and the field has been accepted and ignored since; older supervisors that still send it keep working. Mono-RevId: 7904c59a81b5bf4aa0614cd61f0ab21f7fe663b4
1 parent b9e80bd commit 3ae7e35

11 files changed

Lines changed: 1 addition & 19 deletions

File tree

‎apps/supervisor/src/env.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export const Env = z
7676
.optional(),
7777
TRIGGER_DEQUEUE_INTERVAL_MS: z.coerce.number().int().default(250),
7878
TRIGGER_DEQUEUE_IDLE_INTERVAL_MS: z.coerce.number().int().default(1000),
79-
TRIGGER_DEQUEUE_MAX_RUN_COUNT: z.coerce.number().int().default(1),
8079
TRIGGER_DEQUEUE_MIN_CONSUMER_COUNT: z.coerce.number().int().default(1),
8180
TRIGGER_DEQUEUE_MAX_CONSUMER_COUNT: z.coerce.number().int().default(10),
8281
TRIGGER_DEQUEUE_SCALING_STRATEGY: z.enum(["none", "smooth", "aggressive"]).default("none"),

‎apps/supervisor/src/index.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ class ManagedSupervisor {
347347
dequeueIntervalMs: env.TRIGGER_DEQUEUE_INTERVAL_MS,
348348
dequeueIdleIntervalMs: env.TRIGGER_DEQUEUE_IDLE_INTERVAL_MS,
349349
queueConsumerEnabled: env.TRIGGER_DEQUEUE_ENABLED,
350-
maxRunCount: env.TRIGGER_DEQUEUE_MAX_RUN_COUNT,
351350
queueClass: env.TRIGGER_WORKER_QUEUE_CLASS,
352351
subscriptions: env.TRIGGER_WORKER_QUEUE_SUBSCRIPTIONS,
353352
metricsRegistry: register,

‎apps/webapp/app/routes/engine.v1.worker-actions.dequeue.e2e.test.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,10 @@ describe("dequeue request validation", () => {
7272

7373
const invalidRequests: Array<[body: unknown, status: number]> = [
7474
[{ queueClass: "restore" }, 400],
75-
[{ maxRunCount: "invalid" }, 400],
7675
[{ maxResources: { cpu: "invalid", memory: 1 } }, 400],
7776
[{ subscriptions: [] }, 422],
7877
[{ subscriptions: [{ ...subscription, weight: 2 }] }, 422],
7978
[{ queueClass: "default", subscriptions: [subscription] }, 422],
80-
[{ maxRunCount: "invalid", subscriptions: [] }, 400],
8179
[{ queueClass: "invalid", subscriptions: [subscription] }, 400],
8280
];
8381
for (const [body, status] of invalidRequests) {

‎docs/self-hosting/env/supervisor.mdx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ mode: "wide"
3131
| `TRIGGER_DEQUEUE_ENABLED` | No | true | Enable dequeue to pull runs from the queue. |
3232
| `TRIGGER_DEQUEUE_INTERVAL_MS` | No | 250 | Dequeue interval (ms). |
3333
| `TRIGGER_DEQUEUE_IDLE_INTERVAL_MS` | No | 1000 (1s) | Dequeue idle interval (ms). |
34-
| `TRIGGER_DEQUEUE_MAX_RUN_COUNT` | No | 10 | Max dequeue run count. |
3534
| `TRIGGER_DEQUEUE_MAX_CONSUMER_COUNT` | No | 1 | Max dequeue consumer count. |
3635
| **Docker settings** | | | |
3736
| `DOCKER_API_VERSION` | No | v1.41 | Docker API version. You should probably not touch this. |

‎hosting/k8s/helm/templates/supervisor.yaml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,6 @@ spec:
250250
value: {{ .Values.supervisor.config.dequeue.enabled | quote }}
251251
- name: TRIGGER_DEQUEUE_INTERVAL_MS
252252
value: {{ .Values.supervisor.config.dequeue.intervalMs | quote }}
253-
- name: TRIGGER_DEQUEUE_MAX_RUN_COUNT
254-
value: {{ .Values.supervisor.config.dequeue.maxRunCount | quote }}
255253
- name: TRIGGER_DEQUEUE_IDLE_INTERVAL_MS
256254
value: {{ .Values.supervisor.config.dequeue.idleIntervalMs | quote }}
257255
# Heartbeat configuration

‎hosting/k8s/helm/values.yaml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ supervisor:
336336
dequeue:
337337
enabled: true
338338
intervalMs: 250
339-
maxRunCount: 100
340339
idleIntervalMs: 500
341340
runner:
342341
heartbeatIntervalSeconds: 30

‎internal-packages/run-engine/src/engine/tests/ttl.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,6 @@ describe("RunEngine ttl", () => {
858858
const dequeued = await engine.dequeueFromWorkerQueue({
859859
consumerId: "test-consumer",
860860
workerQueue: "main",
861-
maxRunCount: 1,
862861
backgroundWorkerId: (await prisma.backgroundWorker.findFirst({
863862
where: { runtimeEnvironmentId: authenticatedEnvironment.id },
864863
}))!.id,

‎packages/core/src/v3/runEngineWorker/supervisor/queueConsumer.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export type RunQueueConsumerOptions = {
1919
idleIntervalMs: number;
2020
preDequeue?: PreDequeueFn;
2121
preSkip?: PreSkipFn;
22-
maxRunCount?: number;
2322
/** Which worker-queue class this consumer pulls from. Defaults to the worker's region queue. */
2423
queueClass?: WorkerQueueClass;
2524
subscriptions?: WeightedWorkerQueueSubscription[];
@@ -35,7 +34,6 @@ export class RunQueueConsumer implements QueueConsumer {
3534
private readonly client: SupervisorHttpClient;
3635
private readonly preDequeue?: PreDequeueFn;
3736
private readonly preSkip?: PreSkipFn;
38-
private readonly maxRunCount?: number;
3937
private readonly queueClass?: WorkerQueueClass;
4038
private readonly subscriptions?: WeightedWorkerQueueSubscription[];
4139
private readonly onDequeue: (
@@ -58,7 +56,6 @@ export class RunQueueConsumer implements QueueConsumer {
5856
this.idleIntervalMs = opts.idleIntervalMs;
5957
this.preDequeue = opts.preDequeue;
6058
this.preSkip = opts.preSkip;
61-
this.maxRunCount = opts.maxRunCount;
6259
this.queueClass = opts.queueClass;
6360
this.subscriptions = opts.subscriptions;
6461
this.lastScheduledIntervalMs = opts.idleIntervalMs;
@@ -89,7 +86,6 @@ export class RunQueueConsumer implements QueueConsumer {
8986
enabled: this.isEnabled,
9087
intervalMs: this.intervalMs,
9188
idleIntervalMs: this.idleIntervalMs,
92-
maxRunCount: this.maxRunCount,
9389
preDequeue: !!this.preDequeue,
9490
preSkip: !!this.preSkip,
9591
});
@@ -140,7 +136,6 @@ export class RunQueueConsumer implements QueueConsumer {
140136
try {
141137
const response = await this.client.dequeue({
142138
maxResources: preDequeueResult?.maxResources,
143-
maxRunCount: this.maxRunCount,
144139
queueClass: this.queueClass,
145140
subscriptions: this.subscriptions,
146141
});

‎packages/core/src/v3/runEngineWorker/supervisor/schemas.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ export type WorkerQueueClass = z.infer<typeof WorkerQueueClass>;
8787
export const WorkerApiDequeueRequestBody = z
8888
.object({
8989
maxResources: MachineResources.optional(),
90-
maxRunCount: z.number().optional(),
9190
/** Legacy selection. Absent or "default" targets the worker group's base queue. */
9291
queueClass: WorkerQueueClass.optional(),
9392
/** V2 selection. The server derives region from the authenticated worker. */

‎packages/core/src/v3/runEngineWorker/supervisor/session.test.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ describe("SupervisorSession queue selection", () => {
5050
heartbeatIntervalSeconds: 3600,
5151
dequeueIntervalMs: 10,
5252
dequeueIdleIntervalMs: 10,
53-
maxRunCount: 1,
5453
scaling: { strategy: "none", minConsumerCount: 1, maxConsumerCount: 1 },
5554
...selection,
5655
});
@@ -59,7 +58,7 @@ describe("SupervisorSession queue selection", () => {
5958
await session.start();
6059
expect(await dequeued).toEqual({
6160
path: "/engine/v1/worker-actions/dequeue",
62-
body: { maxRunCount: 1, ...selection },
61+
body: selection,
6362
});
6463
} finally {
6564
await session.stop();

0 commit comments

Comments
 (0)