mqtt-jmeter icon indicating copy to clipboard operation
mqtt-jmeter copied to clipboard

MQTT Protocol deconnexion error

Open laurent-bury opened this issue 8 years ago • 7 comments

Hello,

at the end of each Mqtt test (with "Publisher" component), I have an error 32101 (from the MQTT protocol point of vue, it means 'Client already disconnected',), along with a Java stack like this one:

2017/01/31 16:18:01 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of en d of test 2017/01/31 16:18:01 ERROR - jmeter.protocol.mqtt.sampler.PublisherSampler: Client is disconnec ted java.io.IOException: Client is disconnected at org.apache.jmeter.protocol.mqtt.paho.clients.BlockingClient.close(BlockingClient.java:176) at org.apache.jmeter.protocol.mqtt.client.ClientPool.clearClient(ClientPool.java:42) at org.apache.jmeter.protocol.mqtt.sampler.PublisherSampler.testEnded(PublisherSampler.java:172) at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfEnd(StandardJMeterEngine.java:216) at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:437) at java.lang.Thread.run(Thread.java:745) Caused by: Client is disconnected (32101) at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(Excepti onHelper.java:31) at org.eclipse.paho.client.mqttv3.internal.ClientComms.disconnect(ClientComms.java:422) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.disconnect(MqttAsyncClient.java:537) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.disconnect(MqttAsyncClient.java:506) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.disconnect(MqttAsyncClient.java:513) at org.eclipse.paho.client.mqttv3.MqttClient.disconnect(MqttClient.java:254) at org.apache.jmeter.protocol.mqtt.paho.clients.BlockingClient.close(BlockingClient.ja va:174) ... 5 more__

It also happens when using several threads in jMeter, when each thread is shutting down.

From the server point of vue, we have the following kinf of logs: **2017-02-07 07:22:02.465 INFO 21536 --- [nioEventLoopGroup-3-1] .o.i.c.m.n.UnauthenticatedChannelHandler S[d330e4f1-0bed-423a-9e5f-b8c428fa5506]:RA[/10.0.1.92:36572]:MC[urn:lo:nsid:BenchMQTT:0002]:MU[json+device] : auth failed => CONNACK 'refused' and close : null

So I Wonder if I have something to do in jMeter to close the MQTT session prior to end the test and avoiding this error, or if the problem is due to a bad diconnexion management in the plugin ?

Thank you for your help.

laurent-bury avatar Feb 08 '17 08:02 laurent-bury

Hi i have the same issue, each time i'm using the mqtt publisher i'm getting this exception at the end of the test, but i think i have a more severe issue caused by that- when i'm running my test using jenkins the job does not finish because there are living threads. do you know how to handle this issue?

RamatiAriel avatar Sep 13 '17 08:09 RamatiAriel

Hello,

unfortunately I no longer work on that subject for a while. I remember though that the threads deconnexion issue did not prevent us to simulate workload, and the jMeter script ended correctly anyway, but with errors in the logs...

laurent-bury avatar Sep 13 '17 08:09 laurent-bury

@RamatiAriel , May I now how to reproduce the issue ? I tested the publisher using visualvm and could not find any extra threads running after the tests. I published 100 messages. See attachments.

Before running the tests. before-running-tests

After running the tests after-test

Any other ways to reproduce the mentioned issue ?

Regards,

hemikak avatar Sep 14 '17 18:09 hemikak

Hi @laurent-bury , May I know the steps to reproduce this error ?

2017/01/31 16:18:01 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of en d of test 2017/01/31 16:18:01 ERROR - jmeter.protocol.mqtt.sampler.PublisherSampler: Client is disconnec ted java.io.IOException: Client is disconnected at org.apache.jmeter.protocol.mqtt.paho.clients.BlockingClient.close(BlockingClient.java:176) at org.apache.jmeter.protocol.mqtt.client.ClientPool.clearClient(ClientPool.java:42) at org.apache.jmeter.protocol.mqtt.sampler.PublisherSampler.testEnded(PublisherSampler.java:172) at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfEnd(StandardJMeterEngine.java:216) at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:437) at java.lang.Thread.run(Thread.java:745) Caused by: Client is disconnected (32101) at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(Excepti onHelper.java:31) at org.eclipse.paho.client.mqttv3.internal.ClientComms.disconnect(ClientComms.java:422) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.disconnect(MqttAsyncClient.java:537) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.disconnect(MqttAsyncClient.java:506) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.disconnect(MqttAsyncClient.java:513) at org.eclipse.paho.client.mqttv3.MqttClient.disconnect(MqttClient.java:254) at org.apache.jmeter.protocol.mqtt.paho.clients.BlockingClient.close(BlockingClient.ja va:174) ... 5 more__

hemikak avatar Sep 16 '17 04:09 hemikak

Hi, in order to reproduce this error i've used AsyncClient, used multiple threads (this reproduced when i've used at least 2 threads) and for qos- "at least once". I had 3 MQTT publishers in each thread group with the same client ID, topic, UserName & password (basically it spouse to be the same exact publisher to multiple servers). None of the messages had failed, but only at the end of the test i got this error and my jenkins job did not finish. once I changed to blocking client the error stopped and everything is working. the exception causing this error is: org.eclipse.paho.client.mqttv3.MqttPersistenceException: Persistence already in use i no longer have the full stack trace of this, if there is anything else you need please let me know.

Ariel

RamatiAriel avatar Sep 17 '17 07:09 RamatiAriel

Hello Hemikak,

I apologize, this is an old issue for me now, and I am not able to reproduce it as the environment non longer exists...

laurent-bury avatar Sep 18 '17 08:09 laurent-bury

@laurent-bury ,

No problem.

@RamatiAriel ,

Thanks for the steps. I will try to reproduce it on my end.

Thanks all!

hemikak avatar Sep 21 '17 06:09 hemikak