mqtt/node_modules/mosca/node_modules/mongodb/lib/utils.js:98
process.nextTick(function() { throw err; });
^
TypeError: Cannot set property 'offline' of undefined
at Cursor.<anonymous> (/usr/share/rtlsa/taximqtt/node_modules/mosca/lib/persistence/abstract.js:129:22)
at emitOne (events.js:115:13)
at Cursor.emit (events.js:210:7)
at /usr/share/rtlsa/taximqtt/node_modules/mosca/node_modules/mongodb/lib/cursor.js:1050:14
at handleCallback (/usr/share/rtlsa/taximqtt/node_modules/mosca/node_modules/mongodb/lib/utils.js:96:12)
at /usr/share/rtlsa/taximqtt/node_modules/mosca/node_modules/mongodb/lib/cursor.js:660:20
at handleCallback (/usr/share/rtlsa/taximqtt/node_modules/mosca/node_modules/mongodb-core/lib/cursor.js:159:5)
at /usr/share/rtlsa/taximqtt/node_modules/mosca/node_modules/mongodb-core/lib/cursor.js:577:22
at queryCallback (/usr/share/rtlsa/taximqtt/node_modules/mosca/node_modules/mongodb-core/lib/cursor.js:200:16)
at Callbacks.emit (/usr/share/rtlsa/taximqtt/node_modules/mosca/node_modules/mongodb-core/lib/topologies/server.js:119:3)
at Connection.messageHandler (/usr/share/rtlsa/taximqtt/node_modules/mosca/node_modules/mongodb-core/lib/topologies/server.js:397:23)
at Socket.<anonymous> (/usr/share/rtlsa/taximqtt/node_modules/mosca/node_modules/mongodb-core/lib/connection/connection.js:302:22)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at addChunk (_stream_readable.js:266:12)
at readableAddChunk (_stream_readable.js:253:11)
at Socket.Readable.push (_stream_readable.js:211:10)
at TCP.onread (net.js:585:20)
Hi, persistence has a bug:
persistence/abstract.js:129:22 has:
the
err
is not checked and packet is null !!!!The problem is presented when 500 clients try to reconnect at same time after network failure, persistence is in mongodb.