Errors slowing prosody

Hello,

I have update all components to the latest version but encountered some errors in the process. I have made a rollback to 2.0.4857 (September 1st).
During the update, I have enabled lobby and patched the mod_websocket.lua with mod_websocket_smacks.patch and I suspect one of these to cause an error.
We are using an external turnserver and websockets since 5 months but we had no errors in prosody.err
We have Prosody 0.11.5 with mod_smacks and mod_pinger enabled. We use secure domains.
The configuration is using storage = “memory” since 5 months.

Here are the error logs:

error Traceback[c2s]: /usr/lib/prosody/util/serialization.lua:38: Can’t serialize function
stack traceback:
[C]: in function ‘error’
/usr/lib/prosody/util/serialization.lua:38: in function </usr/lib/prosody/util/serialization.lua:37>
(…tail calls…)
/usr/lib/prosody/util/serialization.lua:196: in function ‘serialize_table’
/usr/lib/prosody/util/serialization.lua:194: in function ‘serialize_table’
/usr/lib/prosody/util/serialization.lua:194: in function ‘serialize_table’
/usr/lib/prosody/util/serialization.lua:220: in function </usr/lib/prosody/util/serialization.lua:218>
(…tail calls…)
/usr/lib/prosody/modules/mod_storage_memory.lua:39: in function </usr/lib/prosody/modules/mod_storage_memory.lua:37>
(…tail calls…)
/usr/lib/prosody/modules/muc/mod_muc.lua:158: in function ‘on_evict’
/usr/lib/prosody/util/cache.lua:57: in function ‘set’
/usr/lib/prosody/modules/muc/mod_muc.lua:176: in function ‘track_room’
/usr/lib/prosody/modules/muc/mod_muc.lua:204: in function </usr/lib/prosody/modules/muc/mod_muc.lua:191>
(…tail calls…)
/usr/lib/prosody/modules/muc/mod_muc.lua:433: in function ‘?’
/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
(…tail calls…)
/usr/lib/prosody/core/stanza_router.lua:180: in function ‘core_post_stanza’
/usr/lib/prosody/core/stanza_router.lua:127: in function ‘core_process_stanza’
/usr/lib/prosody/modules/mod_c2s.lua:275: in function ‘func’
/usr/lib/prosody/util/async.lua:127: in function </usr/lib/prosody/util/async.lua:125>

We have the same error with bosh (users from mobile app I guess):

error Traceback[bosh]: /usr/lib/prosody/util/serialization.lua:38: Can’t serialize function
stack traceback:
SAME AS ABOVE EXCEPT FOR THE LAST LINES
(…tail calls…)
/usr/lib/prosody/core/stanza_router.lua:180: in function ‘core_post_stanza’
/usr/lib/prosody/core/stanza_router.lua:127: in function ‘core_process_stanza’
/usr/lib/prosody/modules/mod_c2s.lua:275: in function ‘func’
/usr/lib/prosody/util/async.lua:127: in function </usr/lib/prosody/util/async.lua:125>

Do you have some clue on what I can do to solve my issue ? It seems like prosody is not closing some sockets. When the errors appear, I even seems slower to authenticate and we are often disconnected from conferences.

I can provide more information if needed.