Skip to content

Commit 75a06d5

Browse files
author
bzhangxmt
committed
Fix Bug 440698 - thread blocked in MqttClient.disconnect()
Signed-off-by: bzhangxmt <zhbinbj@cn.ibm.com>
1 parent 84f25e8 commit 75a06d5

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/internal

org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/internal/ClientState.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,14 @@ protected void undo(MqttPublish message) throws MqttPersistenceException {
524524
*/
525525
public MqttToken checkForActivity() throws MqttException {
526526
final String methodName = "checkForActivity";
527+
528+
synchronized (quiesceLock) {
529+
// ref bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=440698
530+
// No ping while quiescing
531+
if (quiescing) {
532+
return null;
533+
}
534+
}
527535

528536
MqttToken token = null;
529537
long nextPingTime = getKeepAlive();

0 commit comments

Comments
 (0)