Page MenuHomePhabricator

nodejs jobs fail with a v8 fatal error
Closed, ResolvedPublic

Description

Any attempt to run a nodejs based job with jsub fails with the same message.

Jobs are submitted like this (test.js is just a console.log statement).

jsub -l release=trusty node test.js

The result is this error is printed to nodejs.err

FATAL ERROR: v8::Context::New() V8 is no longer usable

Event Timeline

DanielFriesen raised the priority of this task from to Needs Triage.
DanielFriesen updated the task description. (Show Details)
DanielFriesen added a project: Toolforge.
DanielFriesen subscribed.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

This could be a memory issue; the default memory allocation for jobs is 256MB, and not all VMs handle malloc() failing well. I suspect the node VM might be one of them ;-)

For reference, grrrit-wm uses

jsub -l release=trusty -N lolrrit-wm -mem 1G -continuous node /data/project/lolrrit-wm/lolrrit-wm/src/relay.js

i.e., it requests 1GB memory rather than 256MB. I would suggest trying the 1GB option, and maybe decreasing it if qstat shows it doesn't quite need that much.

valhallasw triaged this task as Medium priority.Oct 4 2015, 11:53 AM
valhallasw moved this task from Backlog to Ready to be worked on on the Toolforge board.

You're right. I also tested with 500MB before, but it looks like Node.js requires 1GB of ram even for something as simple as this script:

console.log('...');
valhallasw claimed this task.

Yes, this seems to be a more generic thing with VM-based languages; the same happens for Java and (less so) for Ruby and Python. For Node, the memory usage is ~670MB VMEM (which includes all shared libraries that are loaded, so that's much more than the incremental usage of a single process), while the resident size is only 11MB.

In any case, please don't worry about requesting 1GB of vmem; we've got enough space :-)