fusesource / mqtt-client

A Java MQTT Client
http://mqtt-client.fusesource.org/
Apache License 2.0
1.27k stars 369 forks source link

High CPU when Peer disconnected #76

Open li-yanqing opened 7 years ago

li-yanqing commented 7 years ago

Hi, guys. When I use CallbackConnection to connect server. And another same client id connect again. I found CPU will be 70%~80% used. After reading the codes. I think that maybe about these slices: void handleSessionFailure(Throwable error) { // Socket failure, should we try to reconnect? if( !disconnected && (mqtt.reconnectAttemptsMax<0 || reconnects < mqtt.reconnectAttemptsMax ) ) { ..... } else { // nope. handleFatalFailure(error); } } I think transport needs to be stopped before handleFatalFailure(error).

li-yanqing commented 7 years ago

I find this issue in V1.14

leonpros commented 4 years ago

same on 1.15