MadeByLoosers / noise-box

Broadcasting noise across the internet since 1972 - NoiseBox allows anyone to play sound clips through another computer...
http://noisebox.co
3 stars 3 forks source link

Solve node 0.10 / metadata parser issue #50

Closed orangespaceman closed 11 years ago

orangespaceman commented 11 years ago

With node 0.10, it is possible to see the home page, and also host a room. However, when viewing a room there seems to be with the metadata parser we're using - it worked fine with 0.8 but is infinite-looping now.

Errors are: "warning: possible EventEmitter memory leak detected. 11 listeners added."

And: "EMFILE, too many open files"

I started looking into it, looks like it's the way files are being opened to check the metadata. I dug into the library code a little, it could well be to do with the way they've changed how these file streams work internally in node 0.10: http://nodejs.org/api/stream.html#stream_compatibility

Another option could be to do with node opening too many files for the file system to cope with. If that is the problem, this lib could solve it: https://github.com/isaacs/node-graceful-fs

So for the moment I have disabled the metadata check in /lib/sfx-metadata-parser.js - this at least means we can get the site running with node 0.10, the main downside is temporarily we can't see how long any tracks are.

orangespaceman commented 11 years ago

Sorted - changed the parser.on() methods to parser.once() methods in the sfx-metadata-parser.js file to stop them infinite looping

jedrichards commented 11 years ago

So changing from on() to once() ... is that fixing a problem with the way the musicmetadata lib is interacting with the new Stream API in Node 0.10, or is it just part of the proper way to be using the new stream stuff generally?

On 29 March 2013 08:38, Pete Goodman notifications@github.com wrote:

Sorted - changed the parser.on() methods to parser.once() methods in the sfx-metadata-parser.jshttps://github.com/GuntLondon/noise-box/blob/dev/src/app/lib/sfx-metadata-parser.jsfile to stop them infinite looping

— Reply to this email directly or view it on GitHubhttps://github.com/GuntLondon/noise-box/issues/50#issuecomment-15632718 .

orangespaceman commented 11 years ago

That's a good question.