eclipse-paho / eclipse-paho/paho.mqtt.java
mqtt1.1.1 Timed out as no write activity, error code 32002
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 919
- PR merge metrics
- No merged PRs in 30d
Description
收发消息比较频繁,运行了几个月突然mqtt报出如下错误 (run several months,This error occurs as follow):
Timed out as no write activity, keepAlive=20,000 lastOutboundActivity=1,671,150,138,004 lastInboundActivity=1,671,150,136,450 time=1,671,150,178,005 **lastPing=0**
[2022-12-16 08:22:58.499] ERROR ....ColonyPushCallback 45 - 连接断开,正在重连{}
org.eclipse.paho.client.mqttv3.MqttException: **Timed out while waiting to write messages to the server**
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:31)
at org.eclipse.paho.client.mqttv3.internal.ClientState.checkForActivity(ClientState.java:690)
at org.eclipse.paho.client.mqttv3.internal.ClientComms.checkForActivity(ClientComms.java:758)
at org.eclipse.paho.client.mqttv3.internal.ClientComms.checkForActivity(ClientComms.java:744)
at org.eclipse.paho.client.mqttv3.TimerPingSender$PingTask.run(TimerPingSender.java:78)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)”
[2022-12-16 08:22:58.499] ERROR ...ColonyPushCallback 175 - mqtt发送消息异常:
org.eclipse.paho.client.mqttv3.MqttException: 客户机未连接
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:31)
at org.eclipse.paho.client.mqttv3.internal.ClientComms.sendNoWait(ClientComms.java:177)
at org.eclipse.paho.client.mqttv3.MqttTopic.publish(MqttTopic.java:116)
...
[2022-12-16 08:22:58.499] ERROR ...ColonyPushCallback 175 - mqtt发送消息异常:
org.eclipse.paho.client.mqttv3.MqttException: 客户机未连接
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:31)
at org.eclipse.paho.client.mqttv3.internal.ClientComms.sendNoWait(ClientComms.java:177)
at org.eclipse.paho.client.mqttv3.MqttTopic.publish(MqttTopic.java:116)
....
code error: 32002
This error occurs for the code
org.eclipse.paho.client.mqttv3.internal.ClientState#checkForActivity
if (pingOutstanding == 0 && (time - lastOutboundActivity >= 2*keepAlive)) {
// I am probably blocked on a write operations as I should have been able to write at least a ping message
log.severe(CLASS_NAME,methodName,"642", new Object[]{new Long(this.keepAlive),new Long(lastOutboundActivity),new Long(lastInboundActivity), new Long(time), new Long(lastPing)});
// A ping has not been sent but I am not progressing on the current write operation.
// At this point, assume that the broker has hung and the TCP layer hasn't noticed.
throw ExceptionHelper.createMqttException(MqttException.REASON_CODE_WRITE_TIMEOUT);
}
our version is 1.1.1, the reason is ?
Contributor guide
Assessment
This issue has not been assessed yet.