fbergama / wass

WASS (Waves Acquisition Stereo System) is an optimized stereo processing pipeline for sea waves 3D reconstruction.
GNU General Public License v3.0
40 stars 13 forks source link

Pipeline interface: MaxListenersExceededWarning: Possible EventEmitter memory leak detected. #4

Closed saltynexus closed 6 years ago

saltynexus commented 6 years ago

The Redis version you packed with the precompiled binaries was giving errors, so I ended up downloading the latest version online, installed, and that fixed that. Now I try to run node Wass.js and I get the following error, for which a web search suggests it's something in the programming

Welcome to Wass.js  - 1.0
======================================================
Settings loaded.
Pipeline directory: C:\Users\username\wass_1.1_win32_x64\dist\bin/
Pipeline executables looks good!
Bootstrapping...
Reverting 0 old (prepare) active jobs to inactive
Purging 0 old (prepare) completed jobs
Purging 0 old (prepare) failed jobs
Reverting 0 old (match) active jobs to inactive
Purging 0 old (match) completed jobs
Purging 0 old (match) failed jobs
Reverting 0 old (matchmerge) active jobs to inactive
Purging 0 old (matchmerge) completed jobs
Purging 0 old (matchmerge) failed jobs
Reverting 0 old (extload) active jobs to inactive
Purging 0 old (extload) completed jobs
Purging 0 old (extload) failed jobs
Reverting 0 old (dense) active jobs to inactive
Purging 0 old (dense) completed jobs
Purging 0 old (dense) failed jobs
Queue initialization completed, setting up
----------------------------------------------------
   Progress monitor available at:
     http://localhost:8080

   WassMonitor:
     http://localhost:8080
----------------------------------------------------
Bootstrap completed.
(node:4760) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 job ttl exceeded listeners added
. Use emitter.setMaxListeners() to increase limit
Goodbye
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE :::8080
    at Object._errnoException (util.js:1041:11)
    at _exceptionWithHostPort (util.js:1064:20)
    at Server.setupListenHandle [as _listen2] (net.js:1322:14)
    at listenInCluster (net.js:1370:12)
    at Server.listen (net.js:1466:7)
    at C:\Users\username\wass_1.1_win32_x64\WASSjs\Wass.js:600:16
    at Promise_then_fulfilled (C:\Users\username\wass_1.1_win32_x64\WASSjs\node_modules\q\q.js:766:44)
    at Promise_done_fulfilled (C:\Users\username\wass_1.1_win32_x64\WASSjs\node_modules\q\q.js:835:31)
    at Fulfilled_dispatch [as dispatch] (C:\Users\username\wass_1.1_win32_x64\WASSjs\node_modules\q\q.js:1229:9)
    at Pending_become_eachMessage_task (C:\Users\username\wass_1.1_win32_x64\WASSjs\node_modules\q\q.js:1369:30)
fbergama commented 6 years ago

Looks like the address 8080 is already in use by some other program. Can you verify that?

saltynexus commented 6 years ago

I typed in netstat -a -o in the command line (I'm on a Windows 7 machine) and I don't see anything using port 8080. I also tried to change the port number to 8888 in both the "settings.json" and "Wass.js" and still get the same error. I did notice in your documentation the "settings.json" file has the following setting "http_port": 3000. The file that came with the windows binary package has 8080.

saltynexus commented 6 years ago

OK...for starters, I know nothing about this nodejs/javascript stuff, so be sure to double check my "solution". For the sake of just trying things, I ended up changing "http_port": 8080 in the "settings.json" file (which was per-configured in the windows binary package on the homepage) to "http_port": 3000, as it says in the documentation. I then ran start http://localhost:8080 and the interface opened.

It appears the "solution" requires changing the per-configured "settings.json" file in the windows binary package from "http_port": 8080 to "http_port": 3000. In other words, your documentation is right, but the file you provided needs to be changed.

I will note the following though. When I run node Wass.js, following the fix above, I get the following output

Welcome to Wass.js  - 1.0
======================================================
Settings loaded.
Pipeline directory: C:\Users\username\wass_1.1_win32_x64\dist\bin/
Pipeline executables looks good!
Bootstrapping...
Reverting 0 old (prepare) active jobs to inactive
Purging 0 old (prepare) completed jobs
Purging 0 old (prepare) failed jobs
Reverting 0 old (match) active jobs to inactive
Purging 0 old (match) completed jobs
Purging 0 old (match) failed jobs
Reverting 0 old (matchmerge) active jobs to inactive
Purging 0 old (matchmerge) completed jobs
Purging 0 old (matchmerge) failed jobs
Reverting 0 old (extload) active jobs to inactive
Purging 0 old (extload) completed jobs
Purging 0 old (extload) failed jobs
Reverting 0 old (dense) active jobs to inactive
Purging 0 old (dense) completed jobs
Purging 0 old (dense) failed jobs
Queue initialization completed, setting up
----------------------------------------------------
   Progress monitor available at:
     http://localhost:3000

   WassMonitor:
     http://localhost:8080
----------------------------------------------------
Bootstrap completed.
(node:2460) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 job ttl exceeded listeners added
. Use emitter.setMaxListeners() to increase limit

Everything seems to look good, other than I still see "MaxListenersExceededWarning: Possible EventEmitter memory leak detected." Considering it is just a warning, I'm pushing forward. I did however change the title of the issue to better reflect this warning.

fbergama commented 6 years ago

I'm sorry but I cannot reproduce your problem. If I download the wass_1.1_win32_x64.zip file from the homepage and I open the file WASSjs/settings.json it correctly state "http_port": 3000.

For future reference, http_port does not refer to the port used by WassMonitor (the main web interface offered by Wass) but to the Kue queue monitor provided by the kue library. For now, the port used by Wass is hardcoded to 8080 (it is probably a good idea to make it configurable)

Regarding the MaxListenersExceededWarning I need to investigate that

fbergama commented 6 years ago

Fixed in the latest version of WASS