Skip to content

Commit 546c149

Browse files
add skipClientWorkerSetCheck to worker options
1 parent 858c605 commit 546c149

File tree

7 files changed

+24
-0
lines changed

7 files changed

+24
-0
lines changed

packages/core-bridge/src/worker.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ mod config {
507507
max_activities_per_second: Option<f64>,
508508
max_task_queue_activities_per_second: Option<f64>,
509509
shutdown_grace_time: Option<Duration>,
510+
skip_client_worker_set_check: bool,
510511
}
511512

512513
#[derive(TryFromJs)]
@@ -574,6 +575,7 @@ mod config {
574575
.max_task_queue_activities_per_second(self.max_task_queue_activities_per_second)
575576
.max_worker_activities_per_second(self.max_activities_per_second)
576577
.graceful_shutdown_period(self.shutdown_grace_time)
578+
.skip_client_worker_set_check(self.skip_client_worker_set_check)
577579
.build()
578580
}
579581
}

packages/core-bridge/ts/native.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ export interface WorkerOptions {
221221
maxTaskQueueActivitiesPerSecond: Option<number>;
222222
maxActivitiesPerSecond: Option<number>;
223223
shutdownGraceTime: number;
224+
skipClientWorkerSetCheck: boolean;
224225
}
225226

226227
export type PollerBehavior =

packages/test/src/test-bridge.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ const GenericConfigs = {
306306
maxTaskQueueActivitiesPerSecond: null,
307307
maxActivitiesPerSecond: null,
308308
shutdownGraceTime: 1000,
309+
skipClientWorkerSetCheck: true,
309310
} satisfies native.WorkerOptions,
310311
},
311312
ephemeralServer: {

packages/test/src/test-integration-workflows.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ test('Worker requests Eager Activity Dispatch if possible', async (t) => {
463463
activities: {
464464
testActivity: () => 'workflow-and-activity-worker',
465465
},
466+
skipClientWorkerSetCheck: true,
466467
});
467468
const handle = await startWorkflow(executeEagerActivity);
468469
await activityWorker.runUntil(workflowWorker.runUntil(handle.result()));
@@ -499,6 +500,7 @@ test("Worker doesn't request Eager Activity Dispatch if no activities are regist
499500
});
500501
const workflowWorker = await createWorker({
501502
activities: {},
503+
skipClientWorkerSetCheck: true,
502504
});
503505
const handle = await startWorkflow(dontExecuteEagerActivity);
504506
const result = await activityWorker.runUntil(workflowWorker.runUntil(handle.result()));

packages/test/src/test-sinks.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ if (RUN_INTEGRATION_TESTS) {
261261
sinks,
262262
maxCachedWorkflows: 0,
263263
maxConcurrentWorkflowTaskExecutions: 2,
264+
skipClientWorkerSetCheck: true,
264265
});
265266
const client = new WorkflowClient();
266267
await worker.runUntil(client.execute(workflows.logSinkTester, { taskQueue, workflowId: uuid4() }));
@@ -307,6 +308,7 @@ if (RUN_INTEGRATION_TESTS) {
307308
...defaultOptions,
308309
taskQueue,
309310
sinks,
311+
skipClientWorkerSetCheck: true,
310312
});
311313
const workflowId = uuid4();
312314
await worker.runUntil(client.execute(workflows.logSinkTester, { taskQueue, workflowId }));
@@ -320,6 +322,7 @@ if (RUN_INTEGRATION_TESTS) {
320322
{
321323
...defaultOptions,
322324
sinks,
325+
skipClientWorkerSetCheck: true,
323326
},
324327
history,
325328
workflowId
@@ -351,6 +354,7 @@ if (RUN_INTEGRATION_TESTS) {
351354
...defaultOptions,
352355
taskQueue,
353356
sinks,
357+
skipClientWorkerSetCheck: true,
354358
});
355359
const client = new WorkflowClient();
356360
const workflowId = uuid4();
@@ -411,6 +415,7 @@ if (RUN_INTEGRATION_TESTS) {
411415
...defaultOptions,
412416
taskQueue,
413417
sinks,
418+
skipClientWorkerSetCheck: true,
414419
});
415420
await worker.runUntil(
416421
client.execute(workflows.upsertAndReadSearchAttributes, {

packages/test/src/test-worker-deployment-versioning.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ test('Worker deployment based versioning', async (t) => {
4343
defaultVersioningBehavior: 'PINNED',
4444
},
4545
connection: nativeConnection,
46+
skipClientWorkerSetCheck: true,
4647
});
4748
const worker1Promise = worker1.run();
4849
worker1Promise.catch((err) => {
@@ -58,6 +59,7 @@ test('Worker deployment based versioning', async (t) => {
5859
defaultVersioningBehavior: 'PINNED',
5960
},
6061
connection: nativeConnection,
62+
skipClientWorkerSetCheck: true,
6163
});
6264
const worker2Promise = worker2.run();
6365
worker2Promise.catch((err) => {
@@ -73,6 +75,7 @@ test('Worker deployment based versioning', async (t) => {
7375
defaultVersioningBehavior: 'PINNED',
7476
},
7577
connection: nativeConnection,
78+
skipClientWorkerSetCheck: true,
7679
});
7780
const worker3Promise = worker3.run();
7881
worker3Promise.catch((err) => {
@@ -160,6 +163,7 @@ test('Worker deployment based versioning with ramping', async (t) => {
160163
defaultVersioningBehavior: 'PINNED',
161164
},
162165
connection: nativeConnection,
166+
skipClientWorkerSetCheck: true,
163167
});
164168
const worker1Promise = worker1.run();
165169
worker1Promise.catch((err) => {
@@ -175,6 +179,7 @@ test('Worker deployment based versioning with ramping', async (t) => {
175179
defaultVersioningBehavior: 'PINNED',
176180
},
177181
connection: nativeConnection,
182+
skipClientWorkerSetCheck: true,
178183
});
179184
const worker2Promise = worker2.run();
180185
worker2Promise.catch((err) => {

packages/worker/src/worker-options.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,11 @@ export interface WorkerOptions {
464464
*/
465465
defaultHeartbeatThrottleInterval?: Duration;
466466

467+
/**
468+
* TODO: write
469+
*/
470+
skipClientWorkerSetCheck?: boolean;
471+
467472
/**
468473
* A mapping of interceptor type to a list of factories or module paths.
469474
*
@@ -817,6 +822,7 @@ export type WorkerOptionsWithDefaults = WorkerOptions &
817822
| 'debugMode'
818823
| 'reuseV8Context'
819824
| 'tuner'
825+
| 'skipClientWorkerSetCheck'
820826
>
821827
> & {
822828
interceptors: Required<WorkerInterceptors>;
@@ -968,6 +974,7 @@ function addDefaultWorkerOptions(
968974
stickyQueueScheduleToStartTimeout: '10s',
969975
maxHeartbeatThrottleInterval: '60s',
970976
defaultHeartbeatThrottleInterval: '30s',
977+
skipClientWorkerSetCheck: false,
971978
// 4294967295ms is the maximum allowed time
972979
isolateExecutionTimeout: debugMode ? '4294967295ms' : '5s',
973980
workflowThreadPoolSize: reuseV8Context ? 1 : 2,
@@ -1084,6 +1091,7 @@ export function toNativeWorkerOptions(opts: CompiledWorkerOptionsWithBuildId): n
10841091
maxTaskQueueActivitiesPerSecond: opts.maxTaskQueueActivitiesPerSecond ?? null,
10851092
maxActivitiesPerSecond: opts.maxActivitiesPerSecond ?? null,
10861093
shutdownGraceTime: msToNumber(opts.shutdownGraceTime),
1094+
skipClientWorkerSetCheck: opts.skipClientWorkerSetCheck,
10871095
};
10881096
}
10891097

0 commit comments

Comments
 (0)