The Wayback Machine - https://web.archive.org/web/20220411044907/https://github.com/apify/apify-js/issues/307
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle ENOMEM gracefully in memory snapshotter in AutoscaledPool #307

Open
jancurn opened this issue Feb 14, 2019 · 1 comment
Open

Handle ENOMEM gracefully in memory snapshotter in AutoscaledPool #307

jancurn opened this issue Feb 14, 2019 · 1 comment

Comments

@jancurn
Copy link
Member

@jancurn jancurn commented Feb 14, 2019

Memory snapshotter in AutoscaledPool could handle ENOMEM from spawn gracefully - basically it's also an information that memory is overloaded. Now we just print this error, which is confusing for users:

2019-02-14T10:03:17.148Z ERROR: Snapshotter: Memory snapshot failed.
2019-02-14T10:03:17.149Z   Error: spawn ENOMEM
2019-02-14T10:03:17.151Z     at ChildProcess.spawn (internal/child_process.js:313:11)
2019-02-14T10:03:17.152Z     at exports.spawn (child_process.js:508:9)
2019-02-14T10:03:17.154Z     at childrenOfPid (/home/myuser/node_modules/@apify/ps-tree/index.js:53:21)
2019-02-14T10:03:17.155Z     at childrenOfPid (internal/util.js:235:26)
2019-02-14T10:03:17.162Z     at getMemoryInfo (/home/myuser/node_modules/apify/build/utils.js:268:3)
2019-02-14T10:03:17.240Z     at Snapshotter._snapshotMemory (/home/myuser/node_modules/apify/build/autoscaling/snapshotter.js:241:55)
2019-02-14T10:03:17.251Z     at Timeout.funcWrapper [as _onTimeout] (/home/myuser/node_modules/apify-shared/utilities.js:147:9)
2019-02-14T10:03:17.253Z     at ontimeout (timers.js:498:11)
2019-02-14T10:03:17.254Z     at tryOnTimeout (timers.js:323:5)
2019-02-14T10:03:17.256Z     at Timer.listOnTimeout (timers.js:290:5)
@jancurn
Copy link
Member Author

@jancurn jancurn commented Feb 14, 2019

Another option is to handle this transparently in Apify.getMemoryInfo()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants