Skip to content

Commit 324fe4a

Browse files
josephjclarktaylordowns2000officialasishkumar
authored
Release: worker@1.23.5 cli@1.33.1 (#1372)
* engine: Set max-old-space-size on child process #1368 --------- Co-authored-by: Joe Clark <jclark@openfn.org> * fix(project): include trigger reply fields in version hash (#1362) Signed-off-by: Asish Kumar <officialasishkumar@gmail.com> * fix state growth (#1371) * versions --------- Signed-off-by: Asish Kumar <officialasishkumar@gmail.com> Co-authored-by: Taylor Downs <taylor@openfn.org> Co-authored-by: Asish Kumar <87874775+officialasishkumar@users.noreply.github.com>
1 parent dd3b889 commit 324fe4a

21 files changed

Lines changed: 197 additions & 16 deletions

File tree

integration-tests/cli/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @openfn/integration-tests-cli
22

3+
## 1.0.19
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [b2e7b98]
8+
- @openfn/project@0.14.5
9+
- @openfn/lightning-mock@2.4.12
10+
311
## 1.0.18
412

513
### Patch Changes

integration-tests/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@openfn/integration-tests-cli",
33
"private": true,
4-
"version": "1.0.18",
4+
"version": "1.0.19",
55
"description": "CLI integration tests",
66
"author": "Open Function Group <admin@openfn.org>",
77
"license": "ISC",

packages/cli/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @openfn/cli
22

3+
## 1.33.1
4+
5+
### Patch Changes
6+
7+
- b2e7b98: Include `webhook_reply` and `cron_cursor_job_id` in workflow version hashes.
8+
- Updated dependencies [b2e7b98]
9+
- @openfn/project@0.14.5
10+
311
## 1.33.0
412

513
### Minor Changes

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/cli",
3-
"version": "1.33.0",
3+
"version": "1.33.1",
44
"description": "CLI devtools for the OpenFn toolchain",
55
"engines": {
66
"node": ">=18",

packages/engine-multi/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# engine-multi
22

3+
## 1.11.1
4+
5+
### Patch Changes
6+
7+
- aa833d6: Enforce run memory limits at the child_process level
8+
39
## 1.11.0
410

511
### Minor Changes

packages/engine-multi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/engine-multi",
3-
"version": "1.11.0",
3+
"version": "1.11.1",
44
"description": "Multi-process runtime engine",
55
"main": "dist/index.js",
66
"type": "module",

packages/engine-multi/src/api/call-worker.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type WorkerOptions = {
1212
maxWorkers?: number;
1313
env?: any;
1414
timeout?: number; // ms
15+
memoryLimitMb?: number;
1516
proxyStdout?: boolean; // print internal stdout to console
1617
};
1718

@@ -22,13 +23,19 @@ export default function initWorkers(
2223
options: WorkerOptions = {},
2324
logger: Logger
2425
) {
25-
const { env = {}, maxWorkers = 5, proxyStdout = false } = options;
26+
const {
27+
env = {},
28+
maxWorkers = 5,
29+
memoryLimitMb,
30+
proxyStdout = false,
31+
} = options;
2632

2733
const workers = createPool(
2834
workerPath,
2935
{
3036
maxWorkers,
3137
env,
38+
memoryLimitMb,
3239
proxyStdout,
3340
},
3441
logger

packages/engine-multi/src/engine.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ const createEngine = async (
139139
resolvedWorkerPath,
140140
{
141141
maxWorkers: options.maxWorkers,
142+
memoryLimitMb: defaultMemoryLimit,
142143
proxyStdout: options.proxyStdout,
143144
},
144145
options.logger

packages/engine-multi/src/test/worker-functions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const tasks = {
2424
},
2525
threadId: async () => threadId,
2626
processId: async () => process.pid,
27+
getExecArgv: async () => process.execArgv,
2728
// very very simple intepretation of a run function
2829
// Most tests should use the mock-worker instead
2930
run: async (plan: ExecutionPlan, _input: any, _adaptorPaths: any) => {

packages/engine-multi/src/worker/pool.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export type PoolOptions = {
1818
capacity?: number; // defaults to 5
1919
maxWorkers?: number; // alias for capacity. Which is best?
2020
env?: Record<string, string>; // default environment for workers
21+
memoryLimitMb?: number; // --max-old-space-size for child processes
2122

2223
proxyStdout?: boolean; // print internal stdout to console
2324
};
@@ -83,8 +84,13 @@ function createPool(script: string, options: PoolOptions = {}, logger: Logger) {
8384
let child: ChildProcess;
8485
if (!maybeChild) {
8586
// create a new child process and load the module script into it
87+
const execArgv = ['--experimental-vm-modules', '--no-warnings'];
88+
if (options.memoryLimitMb) {
89+
execArgv.push(`--max-old-space-size=${options.memoryLimitMb}`);
90+
}
91+
8692
child = fork(envPath, [script], {
87-
execArgv: ['--experimental-vm-modules', '--no-warnings'],
93+
execArgv,
8894

8995
env: options.env || {},
9096

0 commit comments

Comments
 (0)