fixed double sending rpc and timeout for lwm2m

This commit is contained in:
YevhenBondarenko 2021-09-27 13:59:55 +03:00 committed by Andrew Shvayka
parent 820b4d7e58
commit 672f93c405
2 changed files with 2 additions and 2 deletions

View File

@ -619,7 +619,7 @@ class DeviceActorMessageProcessor extends AbstractContextAwareMsgProcessor {
if (md.getMsg().getMsg().isPersisted()) { if (md.getMsg().getMsg().isPersisted()) {
systemContext.getTbRpcService().save(tenantId, new RpcId(rpcId), status, null); systemContext.getTbRpcService().save(tenantId, new RpcId(rpcId), status, null);
} }
if (status != RpcStatus.SENT) { if (status != RpcStatus.SENT && !(status == RpcStatus.FAILED && md.isDelivered())) {
sendNextPendingRequest(context); sendNextPendingRequest(context);
} }
} else { } else {

View File

@ -67,7 +67,7 @@ public abstract class RpcDownlinkRequestCallbackProxy<R, T> implements DownlinkR
@Override @Override
public void onError(String params, Exception e) { public void onError(String params, Exception e) {
if (e instanceof TimeoutException) { if (e instanceof TimeoutException || e instanceof org.eclipse.leshan.core.request.exception.TimeoutException) {
transportService.process(client.getSession(), this.request, RpcStatus.TIMEOUT, TransportServiceCallback.EMPTY); transportService.process(client.getSession(), this.request, RpcStatus.TIMEOUT, TransportServiceCallback.EMPTY);
} else if (!(e instanceof ClientSleepingException)) { } else if (!(e instanceof ClientSleepingException)) {
sendRpcReplyOnError(e); sendRpcReplyOnError(e);