@remotion/serverless 4.0.526 → 4.0.528
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/dist/get-tmp-dir.d.ts +0 -6
- package/dist/get-tmp-dir.js +0 -19
- package/dist/leak-detection.d.ts +0 -4
- package/dist/leak-detection.js +0 -40
- package/dist/stackback.d.ts +0 -6
- package/dist/stackback.js +0 -59
- package/dist/why-is-node-running.d.ts +0 -15
- package/dist/why-is-node-running.js +0 -89
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/serverless"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/serverless",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.528",
|
|
7
7
|
"description": "A runtime for distributed rendering",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"scripts": {
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@remotion/renderer": "4.0.
|
|
27
|
-
"@remotion/bundler": "4.0.
|
|
28
|
-
"@remotion/licensing": "4.0.
|
|
29
|
-
"@remotion/serverless-client": "4.0.
|
|
26
|
+
"@remotion/renderer": "4.0.528",
|
|
27
|
+
"@remotion/bundler": "4.0.528",
|
|
28
|
+
"@remotion/licensing": "4.0.528",
|
|
29
|
+
"@remotion/serverless-client": "4.0.528"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
32
|
+
"@remotion/eslint-config-internal": "4.0.528",
|
|
33
33
|
"eslint": "9.19.0",
|
|
34
34
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
35
35
|
},
|
package/dist/get-tmp-dir.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CloudProvider } from '@remotion/serverless-client';
|
|
2
|
-
import type { InsideFunctionSpecifics } from './provider-implementation';
|
|
3
|
-
export declare const getTmpDirStateIfENoSp: <Provider extends CloudProvider<string, Record<string, unknown>, Record<string, unknown>, string, object>>(err: string, insideFunctionSpecifics: InsideFunctionSpecifics<Provider>) => {
|
|
4
|
-
files: import("@remotion/serverless-client").FileNameAndSize[];
|
|
5
|
-
total: number;
|
|
6
|
-
} | null;
|
package/dist/get-tmp-dir.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTmpDirStateIfENoSp = void 0;
|
|
4
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
|
-
const getTmpDirStateIfENoSp = (err, insideFunctionSpecifics) => {
|
|
6
|
-
if (!(0, serverless_client_1.errorIsOutOfSpaceError)(err)) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
const files = insideFunctionSpecifics.getFolderFiles('/tmp');
|
|
10
|
-
return {
|
|
11
|
-
files: files
|
|
12
|
-
.slice(0)
|
|
13
|
-
.sort((a, b) => a.size - b.size)
|
|
14
|
-
.reverse()
|
|
15
|
-
.slice(0, 100),
|
|
16
|
-
total: files.reduce((a, b) => a + b.size, 0),
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
exports.getTmpDirStateIfENoSp = getTmpDirStateIfENoSp;
|
package/dist/leak-detection.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { NodeIntrospection } from './why-is-node-running';
|
|
2
|
-
export declare const stopLeakDetection: () => void;
|
|
3
|
-
export declare const setCurrentRequestId: (awsRequestId: string) => void;
|
|
4
|
-
export declare const startLeakDetection: (leakDetection: NodeIntrospection, awsRequestId: string) => void;
|
package/dist/leak-detection.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startLeakDetection = exports.setCurrentRequestId = exports.stopLeakDetection = void 0;
|
|
4
|
-
const why_is_node_running_1 = require("./why-is-node-running");
|
|
5
|
-
let currentRequestId = null;
|
|
6
|
-
let leakDetectionTimeout = null;
|
|
7
|
-
const stopLeakDetection = () => {
|
|
8
|
-
if (leakDetectionTimeout !== null) {
|
|
9
|
-
clearTimeout(leakDetectionTimeout.timeout);
|
|
10
|
-
leakDetectionTimeout = null;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
exports.stopLeakDetection = stopLeakDetection;
|
|
14
|
-
const setCurrentRequestId = (awsRequestId) => {
|
|
15
|
-
currentRequestId = awsRequestId;
|
|
16
|
-
};
|
|
17
|
-
exports.setCurrentRequestId = setCurrentRequestId;
|
|
18
|
-
const startLeakDetection = (leakDetection, awsRequestId) => {
|
|
19
|
-
currentRequestId = awsRequestId;
|
|
20
|
-
leakDetectionTimeout = {
|
|
21
|
-
awsRequestId,
|
|
22
|
-
timeout: setTimeout(() => {
|
|
23
|
-
// First allow request ID to be set
|
|
24
|
-
setTimeout(() => {
|
|
25
|
-
if (currentRequestId !== awsRequestId) {
|
|
26
|
-
// New function, all good
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
console.log('Leak detected: Lambda function is still running 10s after the render has finished.');
|
|
30
|
-
console.log('You may report this to the Remotion team.');
|
|
31
|
-
console.log('Include the logs below:');
|
|
32
|
-
(0, why_is_node_running_1.whyIsNodeRunning)(leakDetection);
|
|
33
|
-
console.log('Force-quitting the Lambda function now.');
|
|
34
|
-
process.exit(0);
|
|
35
|
-
}, 100);
|
|
36
|
-
}, 10000),
|
|
37
|
-
};
|
|
38
|
-
leakDetectionTimeout.timeout.unref();
|
|
39
|
-
};
|
|
40
|
-
exports.startLeakDetection = startLeakDetection;
|
package/dist/stackback.d.ts
DELETED
package/dist/stackback.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stackback = void 0;
|
|
4
|
-
function FormatStackTrace(error, frames) {
|
|
5
|
-
const lines = [];
|
|
6
|
-
try {
|
|
7
|
-
lines.push(error.toString());
|
|
8
|
-
}
|
|
9
|
-
catch (e) {
|
|
10
|
-
try {
|
|
11
|
-
lines.push('<error: ' + e + '>');
|
|
12
|
-
}
|
|
13
|
-
catch (_a) {
|
|
14
|
-
lines.push('<error>');
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
for (let i = 0; i < frames.length; i++) {
|
|
18
|
-
const frame = frames[i];
|
|
19
|
-
let line;
|
|
20
|
-
try {
|
|
21
|
-
line = frame.toString();
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
try {
|
|
25
|
-
line = '<error: ' + e + '>';
|
|
26
|
-
}
|
|
27
|
-
catch (_b) {
|
|
28
|
-
// Any code that reaches this point is seriously nasty!
|
|
29
|
-
line = '<error>';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
lines.push(' at ' + line);
|
|
33
|
-
}
|
|
34
|
-
return lines.join('\n');
|
|
35
|
-
}
|
|
36
|
-
const stackback = (error) => {
|
|
37
|
-
// save original stacktrace
|
|
38
|
-
const save = Error.prepareStackTrace;
|
|
39
|
-
// replace capture with our function
|
|
40
|
-
Error.prepareStackTrace = function (err, trace) {
|
|
41
|
-
// cache stack frames so we don't have to get them again
|
|
42
|
-
// use a non-enumerable property
|
|
43
|
-
Object.defineProperty(err, '_sb_callsites', {
|
|
44
|
-
value: trace,
|
|
45
|
-
});
|
|
46
|
-
return (save || FormatStackTrace)(err, trace);
|
|
47
|
-
};
|
|
48
|
-
// force capture of the stack frames
|
|
49
|
-
// eslint-disable-next-line no-unused-expressions
|
|
50
|
-
error.stack;
|
|
51
|
-
// someone already asked for the stack so we can't do this trick
|
|
52
|
-
if (!error._sb_callsites) {
|
|
53
|
-
return [];
|
|
54
|
-
}
|
|
55
|
-
// return original capture function
|
|
56
|
-
Error.prepareStackTrace = save;
|
|
57
|
-
return error._sb_callsites;
|
|
58
|
-
};
|
|
59
|
-
exports.stackback = stackback;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import asyncHooks from 'async_hooks';
|
|
2
|
-
type Resource = {
|
|
3
|
-
type: string;
|
|
4
|
-
stacks: NodeJS.CallSite[];
|
|
5
|
-
resource: {
|
|
6
|
-
hasRef?: () => boolean;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export type NodeIntrospection = {
|
|
10
|
-
hook: asyncHooks.AsyncHook | null;
|
|
11
|
-
active: Map<number, Resource>;
|
|
12
|
-
};
|
|
13
|
-
export declare const enableNodeIntrospection: (enabled: boolean) => NodeIntrospection;
|
|
14
|
-
export declare function whyIsNodeRunning({ active, hook }: NodeIntrospection): void;
|
|
15
|
-
export {};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.enableNodeIntrospection = void 0;
|
|
7
|
-
exports.whyIsNodeRunning = whyIsNodeRunning;
|
|
8
|
-
/* eslint-disable no-console */
|
|
9
|
-
const async_hooks_1 = __importDefault(require("async_hooks"));
|
|
10
|
-
const fs_1 = __importDefault(require("fs"));
|
|
11
|
-
const path_1 = require("path");
|
|
12
|
-
const stackback_1 = require("./stackback");
|
|
13
|
-
const enableNodeIntrospection = (enabled) => {
|
|
14
|
-
const active = new Map();
|
|
15
|
-
if (!enabled) {
|
|
16
|
-
return {
|
|
17
|
-
active,
|
|
18
|
-
hook: null,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
const hook = async_hooks_1.default.createHook({
|
|
22
|
-
init(asyncId, type, _triggerAsyncId, resource) {
|
|
23
|
-
if (type === 'TIMERWRAP' || type === 'PROMISE')
|
|
24
|
-
return;
|
|
25
|
-
if (type === 'PerformanceObserver' || type === 'RANDOMBYTESREQUEST')
|
|
26
|
-
return;
|
|
27
|
-
const err = new Error('whatevs');
|
|
28
|
-
const stacks = (0, stackback_1.stackback)(err);
|
|
29
|
-
active.set(asyncId, { type, stacks, resource });
|
|
30
|
-
},
|
|
31
|
-
destroy(asyncId) {
|
|
32
|
-
active.delete(asyncId);
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
hook.enable();
|
|
36
|
-
return { hook, active };
|
|
37
|
-
};
|
|
38
|
-
exports.enableNodeIntrospection = enableNodeIntrospection;
|
|
39
|
-
function whyIsNodeRunning({ active, hook }) {
|
|
40
|
-
if (!hook) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
hook.disable();
|
|
44
|
-
const activeResources = [...active.values()].filter((r) => {
|
|
45
|
-
if (typeof r.resource.hasRef === 'function' && !r.resource.hasRef())
|
|
46
|
-
return false;
|
|
47
|
-
return true;
|
|
48
|
-
});
|
|
49
|
-
console.error('There are %d handle(s) keeping the process running', activeResources.length);
|
|
50
|
-
function printStacks(o) {
|
|
51
|
-
const stacks = o.stacks.slice(1).filter((s) => {
|
|
52
|
-
const filename = s.getFileName();
|
|
53
|
-
return (filename &&
|
|
54
|
-
filename.indexOf(path_1.sep) > -1 &&
|
|
55
|
-
filename.indexOf('internal' + path_1.sep) !== 0);
|
|
56
|
-
});
|
|
57
|
-
console.error('');
|
|
58
|
-
console.error('# %s', o.type);
|
|
59
|
-
if (stacks[0]) {
|
|
60
|
-
let padding = '';
|
|
61
|
-
stacks.forEach((s) => {
|
|
62
|
-
const pad = (s.getFileName() + ':' + s.getLineNumber()).replace(/./g, ' ');
|
|
63
|
-
if (pad.length > padding.length)
|
|
64
|
-
padding = pad;
|
|
65
|
-
});
|
|
66
|
-
stacks.forEach((s) => {
|
|
67
|
-
const prefix = s.getFileName() + ':' + s.getLineNumber();
|
|
68
|
-
try {
|
|
69
|
-
const src = fs_1.default
|
|
70
|
-
.readFileSync(s.getFileName(), 'utf-8')
|
|
71
|
-
.split(/\n|\r\n/);
|
|
72
|
-
console.error(prefix +
|
|
73
|
-
padding.slice(prefix.length) +
|
|
74
|
-
' - ' +
|
|
75
|
-
src[s.getLineNumber() - 1].trim());
|
|
76
|
-
}
|
|
77
|
-
catch (_a) {
|
|
78
|
-
console.error(prefix + padding.slice(prefix.length));
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
console.error('(unknown stack trace)');
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
for (const o of activeResources) {
|
|
87
|
-
printStacks(o);
|
|
88
|
-
}
|
|
89
|
-
}
|