egg icon indicating copy to clipboard operation
egg copied to clipboard

egg-mock: 当app在beforeClose时使用ipc 警告channel closed

Open RaineySpace opened this issue 6 years ago • 0 comments

What happens?

1.app.js 在 beforeClose 中使用ipc广播 2.mock使用cluster启动 3.当app关闭时会触发一个channel closed的警告

不清楚是否是因为进程关闭顺序有问题。

Mini Showcase Repository(REQUIRED)

https://github.com/XueRainey/egg-mock-bug.git

How To Reproduce

Steps to reproduce the behavior:

  1. npm i
  2. npm run test

将会触发如下警告 [Thu Apr 11 2019 15:14:12 GMT+0800 (GMT+08:00)][sendmessage] WARN pid#55871 channel closed, nothing send stack: Error: channel closed at send (/Users/rainey/Code/github/egg-mock-bug/node_modules/sendmessage/index.js:44:13) at Messenger.send (/Users/rainey/Code/github/egg-mock-bug/node_modules/egg/lib/core/messenger/ipc.js:104:5) at Messenger.sendToApp (/Users/rainey/Code/github/egg-mock-bug/node_modules/egg/lib/core/messenger/ipc.js:81:10) at AppBootHook.beforeClose (/Users/rainey/Code/github/egg-mock-bug/app.js:10:24) at Object.callFn (/Users/rainey/Code/github/egg-mock-bug/node_modules/egg-core/lib/utils/index.js:44:42) at Lifecycle.close (/Users/rainey/Code/github/egg-mock-bug/node_modules/egg-core/lib/lifecycle.js:121:19) at processTicksAndRejections (internal/process/next_tick.js:81:5)

Context

  • Node Version: v11.9.0
  • Egg Version: 2.15.1
  • Platform: MacOS

RaineySpace avatar Apr 11 '19 07:04 RaineySpace