NodeSSPI icon indicating copy to clipboard operation
NodeSSPI copied to clipboard

Possible EventEmitter memory leak detected when using perRequestAuth & useSSPI

Open baserz opened this issue 8 years ago • 2 comments

Hi! Noticed that if useSSPI is used in combination with perRequestAuth and you just try press f5 frequently node starts spitting out the following warning: "(node:10936) Warning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit". Keep doing this and node eventually shuts down. This do not occur if useBasic is set to true instead of SSPI. Unsure if its a bug or a limitation but seems worth bringing up.

The sample i used to generate this can be found here: https://github.com/baseless/sspi_sample

baserz avatar Oct 12 '16 19:10 baserz

I can reproduce the msg but the process didn't crash eventually - at least not always. Also, the errors are only generated at the beginning when I hold f5 rather than proportional to the duration the key is down. At this point I consider it a low priority issue, partially because I don't expect perRequestAuth a popular option.

abbr avatar Oct 13 '16 02:10 abbr

Nice that you could reproduce it. The reason as i see with perrequest is when deploying on WIndows Server through IIS (as reverse proxy / httphandler) that if perrequest is set to false, all users are identified as the same connection (i.e, all users will share the authentication of the first logged on user) in node-sspi. So far i have not seen a way of circumventing this.

baserz avatar Oct 13 '16 07:10 baserz