aedes: [Bug] Aedes stops accepting subscribe/ publish
Hello
I have migrated from mosca few days back . I have a test server with ~10 clients connected and another production server with ~400 clients connected. The smaller instance works great but the bigger one stops responding to subscribe and publish requests after few days . Not sure what could be the cause. I checked the CPU/ memory usage. Its not high.
Aedes Code https://pastebin.com/raw/Zbf58pR1
Logs - I only see clients being connected but unable to publish / subscribe
authorize :- device-5e3c5054ca15e200c69dd8c6
client connected Tin-fb49
authorize :- device-5e3c5054ca15e200c69dd8c6
client connected Tin-fb49
authorize :- device-5e3csdfsdfsdfsdfsdfsdfsdfsdf
client connected Tin-fb49
authorize :- device-5e3c5054ca15esdfsdfsdfsdfds
client connected Tin-rewr
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 90 (38 by maintainers)
Commits related to this issue
- fix: clean up the write callbacks in case of error and catch mqtt_parser errors #483 #428 — committed to moscajs/aedes by robertsLando 4 years ago
@robertsLando yeah , problem resolved. I will keep you posted if the problem reappears.
@bhirave It’s useless to call
client.close
on clientError as it’s already called immediatly after that event is emitted: https://github.com/moscajs/aedes/blob/master/lib/client.js#L192@robertsLando I would need at least a week to confirm if the problem is resolved. It happens spordiacly
Thanks @robertsLando . I am really looking forward to hear solution / fix for original thread @mogupta started. so i could take care of it before we perform migration from mosca to aedes. Let me run some benchmarking tools, see what happens with it.
@mogupta I suggest you to pass to aedes the db connection instead of the url and wait for persistence ready before starting the server, that could happen when aedes receives lot messages and the persistence is not ready or/and you could use
mongoPersistence.setMaxListeners
to increese max listeners@bhirave I will try those tomorrow morning IST (when my users are sleeping) . The broker doesn’t seem to be flooded. No matter how I try and how many connections are alive, the broker stops accepting publish messages. no error is returned on the client. I tried with Mqttfx when the broker was misbehaving.
@mogupta i would recommend you to add following subscriptions, so you can get more logging, why subscription being stopped
That’s interesting! I would like to know if @mogupta is using clientsId with 23 or more charaters. There must be a memory leak in connect handler when return code is 2. I will dig into this tomorrow
Daniel
Try with something like
In this way you are sure callback is always called
I started the broker directly using memory, and reached a certain amount of connections, but also appeared that I could not publish or subscribe, but only connect.