You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have upgraded Nodejs from v0.12 to 4.1.2/4.2.1. I have tried both of this latest version.
I am using signalr.js file for connection to server. Running node.js program on windows which is communicating to serialport using serialport module after getting data over signalr. Everything works but after few message exchange betn client and server using signalr, client program stops and not receiving any messages and i am seeing ECONNRESET error.
Everything was working but after upgrade this broke. Trying to figure out this from past couple of days but stil no luck. Is there anything new i have to configure in my node program related to signalr. Is the signalr long polling connection aborting ?
@livesankp can you tell me more about signalr? How are you receiving the data on the server? Are you able to make a minimal example of an application that displays this problem?
@thealphanerd I am using signalr from here http://www.asp.net/signalr
Loading required signalr.js file using require and also loading jQuery, jsdom as a dependancy.
my http calls are fine using jQuery ajax. i am able to receive events in signalr long polling and able to read/write to serialport too. but suddenly program is getting stop. I have tried uncaughexception catch but nothing is being catch.
I have this as a handler.
process.on('uncaughtException', function(error) {
console.error((new Date).toUTCString() + ' uncaughtException:', error.message)
console.error(error.stack);
process.exit(1)
})
Error is
Fri, 30 Oct 2015 19:25:07 GMT uncaughtException: read ECONNRESET
Error: read ECONNRESET
at exports._errnoException (util.js:849:11)
at TCP.onread (net.js:544:26)
exited : 1
I thought it would be due to signalr so i commented its initialization but still able to reproduce this.
Taking my words back for serialport. I re run the program again with commented all code related to jquery ajax service call and signalr and program is not crashing. so looks like it has some issue with continuous long polling connection probably which signalr uses or initial calls done by jquery.
It's not related directly to long polling. It's caused by any HTTP requests issued by jsdom, whose default settings for HTTP are { keepAlive: true, keepAliveMsecs: 115000 }. So it's #3595. For now, just don't call process.exit when this exception happens. It's safe to ignore it, but I'm not sure what's the best way to distinguish it from other uncaught ECONNRESET exceptions.
@thorn0 even i am not using process.exit it is terminating the process. Do you know why ? If you know jsdom is the problem can you share jsdom initialization code with me ?
I had handled too and i commented process.exit line but still it happens. If you don't mind can you show me your jsdom initialization.
This is how i am doing.
//jsdom dependancy of jQuery
var jsdom = require('jsdom').jsdom, document = jsdom('na');
global.window = document.defaultView;
@thorn0 so i run two tests. One for Serialport and One for signalr with jsdom and jquery. When i ran both separately no one failed. But the moment i combined both in same process it stopped. So really confused now why both are not working together.
Activity
Fishrock123 commentedon Oct 26, 2015
@livesankp you said you were using the serialport module on node v4? Did you
npm rebuildsuccessfully?It's a possibility this is the result of a subtle change somewhere, could you perhaps try looking though https://github.com/nodejs/node/wiki/API-changes-between-v0.10-and-v4 for anything suspect?
MylesBorins commentedon Oct 26, 2015
@livesankp can you tell me more about signalr? How are you receiving the data on the server? Are you able to make a minimal example of an application that displays this problem?
livesankp commentedon Oct 26, 2015
@Fishrock123 npm rebuild is successful.
livesankp commentedon Oct 26, 2015
@thealphanerd I am using signalr from here http://www.asp.net/signalr
Loading required signalr.js file using require and also loading jQuery, jsdom as a dependancy.
my http calls are fine using jQuery ajax. i am able to receive events in signalr long polling and able to read/write to serialport too. but suddenly program is getting stop. I have tried uncaughexception catch but nothing is being catch.
thorn0 commentedon Oct 30, 2015
It might be the same issue as #3595. As for
uncaughtException, you could've misspelled the name of this event.livesankp commentedon Oct 30, 2015
I have this as a handler.
process.on('uncaughtException', function(error) {
console.error((new Date).toUTCString() + ' uncaughtException:', error.message)
console.error(error.stack);
process.exit(1)
})
Error is
Fri, 30 Oct 2015 19:25:07 GMT uncaughtException: read ECONNRESET
Error: read ECONNRESET
at exports._errnoException (util.js:849:11)
at TCP.onread (net.js:544:26)
exited : 1
I thought it would be due to signalr so i commented its initialization but still able to reproduce this.
I am sure it is due to serialport now.
livesankp commentedon Oct 30, 2015
Taking my words back for serialport. I re run the program again with commented all code related to jquery ajax service call and signalr and program is not crashing. so looks like it has some issue with continuous long polling connection probably which signalr uses or initial calls done by jquery.
thorn0 commentedon Oct 30, 2015
It's not related directly to long polling. It's caused by any HTTP requests issued by jsdom, whose default settings for HTTP are
{ keepAlive: true, keepAliveMsecs: 115000 }. So it's #3595. For now, just don't callprocess.exitwhen this exception happens. It's safe to ignore it, but I'm not sure what's the best way to distinguish it from other uncaughtECONNRESETexceptions.livesankp commentedon Oct 31, 2015
@thorn0 even i am not using process.exit it is terminating the process. Do you know why ? If you know jsdom is the problem can you share jsdom initialization code with me ?
thorn0 commentedon Oct 31, 2015
Just handling
uncaughtExceptionworks fine for me. I didn't change jsdom's config for it to work.livesankp commentedon Oct 31, 2015
I had handled too and i commented process.exit line but still it happens. If you don't mind can you show me your jsdom initialization.
This is how i am doing.
//jsdom dependancy of jQuery
var jsdom = require('jsdom').jsdom, document = jsdom('na');
global.window = document.defaultView;
//jQuery
var $ = require('jquery');
$.support.cors = true;
window.jQuery = $;
//SignalR added externally, Configuration, Common functions, Constant
var signalr = require('./util/jquery.signalR-2.2.0.js');
livesankp commentedon Nov 2, 2015
@thorn0 so i run two tests. One for Serialport and One for signalr with jsdom and jquery. When i ran both separately no one failed. But the moment i combined both in same process it stopped. So really confused now why both are not working together.
thorn0 commentedon Nov 2, 2015
Just try disabling keep-alive:
It should help if it's really the same issue as #3595.
jasnell commentedon Mar 22, 2016
Closing as it does not appear to be an actionable issue.