emqx / mqtt-jmeter

MQTT JMeter Plugin
https://www.emqx.com/en
Apache License 2.0
445 stars 194 forks source link

MQTT Connect timeout value is ignored #108

Closed frankyfish closed 6 months ago

frankyfish commented 2 years ago

In current plugin version(2.0.2) MQTT Connect timeout value is ignored during CONNECT.

Steps to reproduce: 1) Set some big timeout value image 2) Make MQTT Broker to respond with CONNACK longer than 10 sec (default timeout value for the client)

ER Test is able to connect to the broker even after some of waiting for response (>10sec)

AR Test is failing with a timeout exception, see stacktrace below. Nov 11, 2021 1:56:12 PM net.xmeter.samplers.ConnectSampler sample SEVERE: Failed to establish Connection null java.util.concurrent.ExecutionException: com.hivemq.client.mqtt.mqtt3.exceptions.Mqtt3DisconnectException: Timeout while waiting for CONNACK at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395) at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022) at net.xmeter.samplers.mqtt.hivemq.HiveMQTTClient.connect(HiveMQTTClient.java:78) at net.xmeter.samplers.ConnectSampler.sample(ConnectSampler.java:91) at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638) at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: com.hivemq.client.mqtt.mqtt3.exceptions.Mqtt3DisconnectException: Timeout while waiting for CONNACK Problem comes from the fact that value from Timeout(s) field in UI is never passed to hivemq client instance and is only used for waiting a CompletableFuture with connect request to finish.

frankyfish commented 2 years ago

Should be fixed in PR

vishnubsanap commented 1 year ago

Hi Team,

This issue has not resolved yet for me. I am getting connection drop after 20 concurrency. Please help on this.

Thanks, Vishnu.