Skip to content

egg-socket.io sticky mode bug. #1034

@shyser

Description

@shyser
  • Node Version: 8.0.0
  • Egg Version: 1.4.0
  • Plugin Name: egg-socket.io
  • Plugin Version: 1.2.2
  • Platform: Ubuntu 16.04
  • Mini Showcase Repository:

egg-socket.io由于#997而退回到了 1.x 。

错误日志:

2017-06-12 13:30:47,102 ERROR 25808 nodejs.TypeError: Cannot read property 'emit' of null (uncaughtException throw 1 times on pid:25808)
    at Socket.socketOnTimeout (_http_server.js:386:34)
    at emitNone (events.js:105:13)
    at Socket.emit (events.js:207:7)
    at Socket._onTimeout (net.js:401:8)
    at ontimeout (timers.js:488:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:283:5)

复现步骤:

  1. 用脚手架创建一个项目;
  2. 添加egg-socket.io插件;
  3. 启动参数里添加sticky: true
  4. 启动程序,访问127.0.0.1:7001,5秒钟之后出现错误提示。

补充说明:
我的项目在node 7.x 添加上sticky参数是正常的。前几天升了node 8,重新安装了node_modules,然后就出了这个问题。事实上,如果我不添加sticky的话,是没有这个报错的,但是官方文档上明确说过需要启用sticky mode的。我对这个sticky不咋了解,所以很不放心。

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions