Many MQTT threads with the Alpakka connector


(Christopher Hunt) #1

I’m yet to look into this, so I’m not quite ready to create an issue. However, I noticed that the MQTT connector (or perhaps my use of it!) is creating many, many threads. Here’s a snapshot reported by Landlord:

RESOURCE RETENTION - Process 3 has 105 thread(s) still running - check that your shutdown hooks and/or `trap` handler is shutting down all that it needs to.
Remaining threads: MQTT Rec: mqtt-gateway-2719551524279538, MQTT Call: mqtt-gateway-2719550897055238, MQTT Rec: mqtt-gateway-2719551286381638, MQTT Snd: mqtt-gateway-2719551361188338, MQTT Rec: mqtt-gateway-2719550238613838, pool-38-thread-2, MQTT Snd: mqtt-gateway-2719551591646338, MQTT Call: mqtt-gateway-2719550844081638, MQTT Disc: mqtt-gateway-2719551036021238, pool-22-thread-3, MQTT Rec: mqtt-gateway-2719550844081638, pool-67-thread-5, MQTT Disc: mqtt-gateway-2719551524279538, MQTT Disc: mqtt-gateway-2719551603957838, MQTT Disc: mqtt-gateway-2719550897055238, MQTT Disc: mqtt-gateway-2719551286381638, pool-76-thread-5, MQTT Call: mqtt-gateway-2719551361188338, MQTT Call: mqtt-gateway-2719551718634838, MQTT Disc: mqtt-gateway-2719550804533038, MQTT Disc: mqtt-gateway-2719551718634838, MQTT Disc: mqtt-gateway-2719551382177638, MQTT Con: mqtt-gateway-2719551718634838, MQTT Call: mqtt-gateway-2719551733709038, MQTT Disc: mqtt-gateway-2719550844081638, MQTT Snd: mqtt-gateway-2719550755263138, MQTT Rec: mqtt-gateway-2719550232481238, pool-68-thread-4, MQTT Snd: mqtt-gateway-2719550232481238, pool-46-thread-5, MQTT Snd: mqtt-gateway-2719551382177638, pool-11-thread-5, MQTT Call: mqtt-gateway-2719550904022938, MQTT Disc: mqtt-gateway-2719551339804338, MQTT Snd: mqtt-gateway-2719550844081638, MQTT Snd: mqtt-gateway-2719550897055238, MQTT Call: mqtt-gateway-2719550755263138, MQTT Disc: mqtt-gateway-2719551361188338, pool-15-thread-2, pool-54-thread-5, MQTT Disc: mqtt-gateway-2719550161223438, MQTT Call: mqtt-gateway-2719550238613838, MQTT Call: mqtt-gateway-2719551603957838, MQTT Snd: mqtt-gateway-2719551286381638, MQTT Rec: mqtt-gateway-2719551733709038, MQTT Con: mqtt-gateway-2719551339804338, MQTT Call: mqtt-gateway-2719551339804338, MQTT Call: mqtt-gateway-2719551036021238, MQTT Snd: mqtt-gateway-2719551733709038, MQTT Call: mqtt-gateway-2719551002797838, MQTT Rec: mqtt-gateway-2719551337786138, MQTT Rec: mqtt-gateway-2719550171110038, MQTT Snd: mqtt-gateway-2719550904022938, MQTT Call: mqtt-gateway-2719550161223438, MQTT Rec: mqtt-gateway-2719550755263138, MQTT Snd: mqtt-gateway-2719551603957838, MQTT Snd: mqtt-gateway-2719550238613838, MQTT Disc: mqtt-gateway-2719550238613838, MQTT Snd: mqtt-gateway-2719550171110038, MQTT Call: mqtt-gateway-2719551524279538, MQTT Disc: mqtt-gateway-2719551591646338, MQTT Disc: mqtt-gateway-2719550904022938, pool-28-thread-5, MQTT Rec: mqtt-gateway-2719551603957838, MQTT Call: mqtt-gateway-2719551591646338, MQTT Call: mqtt-gateway-2719551286381638, MQTT Snd: mqtt-gateway-2719551524279538, MQTT Snd: mqtt-gateway-2719551036021238, MQTT Con: mqtt-gateway-2719551337786138, MQTT Disc: mqtt-gateway-2719551337786138, MQTT Rec: mqtt-gateway-2719551036021238, pool-1-thread-5, MQTT Call: mqtt-gateway-2719550804533038, MQTT Rec: mqtt-gateway-2719551718634838, MQTT Rec: mqtt-gateway-2719551382177638, pool-59-thread-5, pool-74-thread-5, pool-26-thread-5, MQTT Rec: mqtt-gateway-2719551002797838, pool-63-thread-5, MQTT Disc: mqtt-gateway-2719551002797838, MQTT Call: mqtt-gateway-2719551337786138, MQTT Call: mqtt-gateway-2719550171110038, MQTT Disc: mqtt-gateway-2719551733709038, pool-20-thread-5, MQTT Rec: mqtt-gateway-2719550904022938, MQTT Call: mqtt-gateway-2719550232481238, pool-55-thread-5, MQTT Con: mqtt-gateway-2719550171110038, MQTT Con: mqtt-gateway-2719551002797838, pool-35-thread-5, pool-19-thread-3, MQTT Con: mqtt-gateway-2719550161223438, MQTT Snd: mqtt-gateway-2719550804533038, MQTT Rec: mqtt-gateway-2719550804533038, MQTT Disc: mqtt-gateway-2719550232481238, MQTT Disc: mqtt-gateway-2719550171110038, MQTT Call: mqtt-gateway-2719551382177638, pool-56-thread-5, MQTT Rec: mqtt-gateway-2719550161223438, MQTT Rec: mqtt-gateway-2719550897055238, MQTT Disc: mqtt-gateway-2719550755263138, MQTT Rec: mqtt-gateway-2719551339804338, MQTT Rec: mqtt-gateway-2719551361188338, MQTT Rec: mqtt-gateway-2719551591646338

As stated, it could be something I’m doing. I’m asking here mainly to see if there are any fairly recent changes to MQTT that might cause this. Thanks.


(Christopher Hunt) #2

UPDATE: Perhaps this Paho issue explains it? https://github.com/eclipse/paho.mqtt.java/issues/402


(Christopher Hunt) #3

I’m going to take this issue into Alpakka: https://github.com/akka/alpakka/issues/892