mysql econnreset_如何在Node.js中调试错误ECONNRESET?

我正在使用Socket.io运行Express.js应用程序用于聊天Web应用程序,并且在24小时内大约5次随机收到以下错误。节点进程将被永久封装,并立即重新启动。

问题是重新启动Express将我的用户踢出他们的房间,没人希望这样做。

Web服务器由HAProxy代理。仅使用websockets和flashsockets传输就没有套接字稳定性问题。我无法有意复制此内容。

这是Node的错误v0.10.11:

events.js:72

throw er; // Unhandled 'error' event

^

Error: read ECONNRESET //alternatively it s a 'write'

at errnoException (net.js:900:11)

at TCP.onread (net.js:555:19)

error: Forever detected script exited with code: 8

error: Forever restarting script for 2 time

编辑(2013-07-22)

添加了socket.io客户端错误处理程序和未捕获的异常处理程序。似乎此错误捕获了:

process.on('uncaughtException', function (err) {

console.error(err.stack);

console.log("Node NOT Exiting...");

});

So I suspect it's not a Socket.io issue but an HTTP request to another server

that I do or a MySQL/Redis connection. The problem is that the error stack

doesn't help me identify my code issue. Here is the log output:

Error: read ECONNRESET

at errnoException (net.js:900:11)

at TCP.onread (net.js:555:19)

How do I know what causes this? How do I get more out of the error?

Ok, not very verbose but here's the stacktrace with Longjohn:

Exception caught: Error ECONNRESET

{ [Error: read ECONNRESET]

code: 'ECONNRESET',

errno: 'ECONNRESET',

syscall: 'read',

__cached_trace__:

[ { receiver: [Object],

fun: [Function: errnoException],

pos: 22930 },

{ receiver: [Object], fun: [Function: onread], pos: 14545 },

{},

{ receiver: [Object],

fun: [Function: fireErrorCallbacks],

pos: 11672 },

{ receiver: [Object], fun: [Function], pos: 12329 },

{ receiver: [Object], fun: [Function: onread], pos: 14536 } ],

__previous__:

{ [Error]

id: 1061835,

location: 'fireErrorCallbacks (net.js:439)',

__location__: 'process.nextTick',

__previous__: null,

__trace_count__: 1,

__cached_trace__: [ [Object], [Object], [Object] ] } }

Here I serve the flash socket policy file:

net = require("net")

net.createServer( (socket) =>

socket.write("<?xml version=\"1.0\"?>\n")

socket.write(""http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\">\n")

socket.write("\n")

socket.write("\n")

socket.write("\n")

socket.end()

).listen(843)

Can this be the cause?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值