Browse Source

fixed race condition during unreq

pull/5018/head
YevhenBondarenko 5 years ago
committed by Andrew Shvayka
parent
commit
309715641f
  1. 7
      common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientContextImpl.java

7
common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientContextImpl.java

@ -93,7 +93,12 @@ public class LwM2mClientContextImpl implements LwM2mClientContext {
log.debug("Fetched clients from store: {}", fetchedClients);
fetchedClients.forEach(client -> {
lwM2mClientsByEndpoint.put(client.getEndpoint(), client);
updateFetchedClient(nodeId, client);
try {
client.lock();
updateFetchedClient(nodeId, client);
} finally {
client.unlock();
}
});
}

Loading…
Cancel
Save