Hi, While testing Stratos 4.1 M3, I noticed about half the times, unsubscribing a cartridge takes 60+ seconds to execute. During that time, the caller is blocked. I poke around Stratos code and found TopicPublisher class that is responsible for the 60 second retry delay. The code sleeps for 60 seconds whenever we encounter an exception while posting the given message to its corresponding topic. Looks like this code has been around since at least release 4.0.0.
It seems to me 60 sec delay is way to long. If you have a lot of subscriptions, the delay can be multiple factor of 60 seconds. Also, if you do this via Stratos' Rest API, the request might get timed out before the response comes back? I reduced this delay from 60 seconds to one second and tested and noticed that worked just fine. I'm planning to push this change upstream unless I get any objection on that. As for why the exception while attempting to update the topic, I did some googling and found [1]. It seems this is an issue with mqtt-client. Somehow we're getting a stale connection to MB when we update the topic. We're currently using version 0.4.0 of mqtt-client. From [2], it looks like the latest version is 1.0.0. Maybe it's time to upgrade? Other question: when I make a Rest call to get list of subscriptions and it returns nothing, is it safe to assume all spawn instances have been killed? Regards, -Jeffrey [1] https://github.com/openhab/openhab/issues/980 [2] http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git/
