-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
运行一段时间,再上报就出错了,日志如下,求解???? #26
Comments
另一段日志 TypeError [ERR_INVALID_CALLBACK]: Callback must be a function |
node 版本是多少?切换到 6.x 试试? |
我用的是node版本是10.4.1,谢谢 |
老铁,这个问题有头绪嘛,遇到同样的问题,跑一段时间就报错ERR_IPC_CHANNEL_CLOSED |
@caihuiji 来改bug了 看了一下代码,ERR_IPC_CHANNEL_CLOSED 是因为 realTotalWorker 有异常没有处理,导致 cluster.fork 的 worker 退出了,这种情况为了保证健壮性,有两个解决方案: 1、在代码 https://github.com/BetterJS/badjs-storage/blob/591e1d142607407eb37a7c88665c35d605ca96b6/service/realTotalMaster.js#L22 处新增 disconnect/error/exit(三选一即可)的事件监听,在 worker 退出时,重新 fork 一个新的 2、在代码 https://github.com/BetterJS/badjs-storage/blob/591e1d142607407eb37a7c88665c35d605ca96b6/service/realTotalWorker.js 新增一个 process unhandledRejection 和 uncaughtException 的异常处理,保证遇到未知的错误不会导致进程退出 |
估计node 10 ipc 有问题。 我得找时间看看 @haoshengqian 是跑起来多久会有问题哈 |
默认设置下,跑一个小时就会报错ERR_IPC_CHANNEL_CLOSED,怀疑是不是某个一小时跑一次的任务导致的 |
关注 |
realTotalMaster.js line:23 新增一段: |
[2018-06-27 10:03:55.576] [DEBUG] [default] - ===== complete a message =====
[2018-06-27 10:03:55.577] [DEBUG] [default] - badjs3| {"msg":"Uncaught TypeError: window.plugins.jPushPlugin.setStatisticsOpen is not a function","target":"file:///android_asset/www/app/app.js","rowNum":297,"colNum":48,"ext":"{}","from":"file:///android_asset/www/index.html#/login","level":4,"id":3,"uin":"123","ip":"::ffff:192.168.11.106","userAgent":"Mozilla/5.0 (Linux; Android 6.0.1; vivo Y55A Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043220 Safari/537.36","date":1530065035576}
events.js:167
throw er; // Unhandled 'error' event
^
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
at ChildProcess.target.send (internal/child_process.js:627:16)
at Worker.send (internal/cluster/worker.js:40:28)
at Object.increase (/usr/local/crashReport-oaapp/badjs-installer/badjs-storage/service/realTotalMaster.js:30:23)
at /usr/local/crashReport-oaapp/badjs-installer/badjs-storage/storage/MongodbStorage.js:150:22
at wrappedMapper (/usr/local/crashReport-oaapp/badjs-installer/badjs-storage/node_modules/map-stream/index.js:84:19)
at Stream.stream.write (/usr/local/crashReport-oaapp/badjs-installer/badjs-storage/node_modules/map-stream/index.js:96:21)
at Stream.ondata (internal/streams/legacy.js:15:31)
at Stream.emit (events.js:182:13)
at queueData (/usr/local/crashReport-oaapp/badjs-installer/badjs-storage/node_modules/map-stream/index.js:43:21)
at next (/usr/local/crashReport-oaapp/badjs-installer/badjs-storage/node_modules/map-stream/index.js:71:7)
Emitted 'error' event at:
at ChildProcess.Worker.process.on (internal/cluster/worker.js:25:12)
at ChildProcess.emit (events.js:182:13)
at process.nextTick (internal/child_process.js:631:35)
at process._tickCallback (internal/process/next_tick.js:61:11)
[2018-06-27 10:05:05.423] [DEBUG] [default] - the operation is: log --operation: queryLogList
[2018-06-27 10:05:05.424] [DEBUG] [default] - query url : http://127.0.0.1:9000/query
[2018-06-27 10:05:05.424] [DEBUG] [default] - query param : id=3&startDate=1529891580000&endDate=1530064380000&index=0&t=%221530065105964%22&level=%5B%221%22%2C%222%22%2C%224%22%5D&=1
[2018-06-27 10:05:05.426] [WARN] [default] - error :Error: connect ECONNREFUSED 127.0.0.1:9000
^C
The text was updated successfully, but these errors were encountered: