Skip to content

Commit cda0d73

Browse files
blackstar-babaShvaykaDChantsovaEkaterinasmatvienko-tbrusikv
authored
merge 3.3.1 (#1)
* improved tests for proto fields explicit presence validation * UI: add custom interval option to charts comparison * test scope: dependency upgrade a refactor for all POMs in project * test scope: comments edited on versions for the test scope and blackbox test scope * dependency org.apache.httpcomponents httpclient moved from blackboxtests to the room POM. httpclient used in edge, but not explicitly added by dependency management. httpclient version with no change. * rollback testcontainers version to 1.11.4 due to the newest testcontainers does not support "container_name" in docker compose * UI: add copy user id button in user details * Revert "rollback testcontainers version to 1.11.4 due to the newest testcontainers does not support "container_name" in docker compose" This reverts commit 8bdd437. * dependency org.apache.httpcomponents httpclient moved from blackboxtests to the room POM. httpclient used in edge, but not explicitly added by dependency management. httpclient version with no change. * UI: name function typo fix * testcontainers - copy source dir to tmp, remove container_name in tmp, run, cleanup tmp on stop. * UI: change maps widget bundle template * UI: Multiple attributes widget, patterns support in widget title * changed slider thumbnail size * Version set to 3.3.1-SNAPSHOT * UI:add input widgets required field option * Implemented rpc sending sequence * Update versions to 3.3.1 in package.json * Change json property order in model WidgetTypeDetails * UI: Added check for DOM element existence before calling draw function * added new RPC statuses * improvement custom translation for alarm type field * Edge functionality enabled by default * added sequence for the all RPC * refactoring * fix bug no entity label for dachboard state * used timeout from yml * send next rpc after removing * send next rpc after removing * UI: Delete custom type leaflet-editable, add default @types/leaflet-editable * UI: Added support for UTF-8 characters in MQTT credential Client ID * Session Activity reporting is isolated and supports short-lived sessions * Sequential RPC processing support * Disabled tooltips on Charts widgets * Add markdown/HTML widget * Improve markdown widget css processing * Add upgrade to 3.3.1 * Update docker pkg upgrade version * Change enableTooltip to showTooltip and change to true by default * chenge befault on true * UI: reduced minimum time for power mode settings * Added logs for edge license check. Replaced Object class with JsonNode * Fix: resources-library page can't be redirected In SysAdmin HomePage, "resources-library" page can't be redirected * dependency management: org.springframework:spring-core (version with no change, exclusions replaced with transitive dependency management * dependency management: com.fasterxml (version unified with general jackson.version (no change), exclusions replaced with transitive dependency management), fasterxml-classmate version defined * dependency management: io.netty (version unified with general netty.version (no change), exclusions replaced with transitive dependency management) * grpc: grpc-netty replaced with grpc-netty-shaded to decouple grpc and netty versions in the project (CE) * grpc: grpc-netty replaced with grpc-netty-shaded (edge-api) * grpc: replaced imports for grpc-netty-shaded (io.grpc.netty. -> io.grpc.netty.shaded.io.grpc.netty.) (CE) * dependency management: added commons-codec commons-logging in dep management (only greater available version in the classpath left) * dependency management: removed unnecessary exclude commons-io from org.owasp.antisamy because commons-io already defined in dependencyManagement (transitive dependency are managed as well) * dependency management: joda-time unified only newer available version in the classpath left (2.3, 2.4, 2.8.1 -> 2.8.1) * dependency management: apache httpclient (4.5.2, 4.5.13 -> 4.5.13), httpcore (4.4.5, 4.4.13, 4.4.14 -> 4.4.14) * dependency management: removed aws.sdk.version (already defined in the root pom.xml with the same version) * dependency management: proto-google-common-protos (1.16.0, 1.17.0, 2.0.1 -> 2.0.1 /required by common used grpc 1.38.0/ ). Version management moved to the root * msa-black-box-tests: httpclient dependency version inherited from the root pom.xml * EdgeGrpcClient: added compression * Added default timeout for asynchronous requests * Update locale.constant-de_DE.json * Update locale.constant-de_DE.json * Update locale.constant-de_DE.json * Refactoring: Introduced Edge License service. Remove web dependency from dao * UI: Fixed toggle to editor full-screen mode in JSON forms * Validation and Replacement of Queue names in the Device profile * Improve queue name selector * fix defaultConfig * Improved SSL context init - trust manager can be build without custom cert file * LwM2M improved tracking of sent requests * Fixed has not been used property SECURITY_USER_LOGIN_CASE_SENSITIVE on password recover * Change button close to reset add change default changeDetection to onPush * UI: When clicking the button "Show on widget", the default widget bundle did not always work * Update rule node UI * Update UserServiceImpl.java * UI: Refactoring attributes-table component, add changeDetection for load widget bundle * Fix HTTP interceptor loading state handling * Update attribute-table.component.ts * Update widgets-bundle-select.component.ts * UI: extend list of rxjs operators available in widget context * remove reset button form filter panel and add clear filter button to table config * remove isEqual form imports and remove changeDetection from component * UI: Fixed load counter - requests were not counted when cancel them * added netty-tcnative-boringssl-static.version 2.0.41.Final along with netty-all to support SSL * tests: maven-surefire-plugin upgraded 3.0.0-M1 -> 3.0.0-M5 * dependency: netty latest 4.1.67, netty-tcnative-boringssl 2.0.40 (according to the optional netty-transport dependency) * executors: names added, shutdownNow for some executors to prevent memory leaks during lifecycle (mostly affects the test runner JVM) * executors: shutdownNow added for tb-rule-engine-consumer-repartition executor on @PreDestroy * black-box-test: fixed import ThingsBoardThreadFactory * tests: call destroy for lwm2m devices to shut down executors inside fwLwM2MDevice and swLwM2MDevice in the test scope * tests: Coap client destroy on processAfterTest at AbstractCoapIntegrationTest * executors: named fixed thread pools; tests - added executor shutdown on tearDown * test: assert not null COAP response instead NullPointerException (to clarify the test failure cause) * dependency-hotfix-after-merge-ce (httpclient doubled, test dependency outdated) * Fix imports * Fix device profile update handling by rule node - preserve old key values to correctly update entity keys snapshot * Update nashorn sandbox version to 0.2.1 * Rule chain actor message processor: added log onTellNext * RuleChainActorMessageProcessor: onTellNext null pointer fix * Improve js executor kafka consumer to exit application in case of not retryable error. * update mdi.svg icon and remove some icon from app.component * UI: Added protection for invalid device profile alarm condition data * Handle Device service transactional methods exceptions (fix exception handling for devices with same name) * Revert "Handle Device service transactional methods exceptions (fix exception handling for devices with same name)" This reverts commit b67f454 * Save and flush device during transaction to trigger constraint validation. * Version set to 3.3.1-SNAPSHOT * Version set to 3.3.1 Co-authored-by: ShvaykaD <[email protected]> Co-authored-by: Chantsova Ekaterina <[email protected]> Co-authored-by: Sergey Matvienko <[email protected]> Co-authored-by: rusikv <[email protected]> Co-authored-by: Andrii Shvaika <[email protected]> Co-authored-by: ArtemDzhereleiko <[email protected]> Co-authored-by: YevhenBondarenko <[email protected]> Co-authored-by: Igor Kulikov <[email protected]> Co-authored-by: Vladyslav_Prykhodko <[email protected]> Co-authored-by: Volodymyr Babak <[email protected]> Co-authored-by: Chris <[email protected]> Co-authored-by: Igor Kulikov <[email protected]>
1 parent e610939 commit cda0d73

File tree

213 files changed

+2344
-1222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+2344
-1222
lines changed

application/pom.xml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<modelVersion>4.0.0</modelVersion>
2121
<parent>
2222
<groupId>org.thingsboard</groupId>
23-
<version>3.3.0</version>
23+
<version>3.3.1</version>
2424
<artifactId>thingsboard</artifactId>
2525
</parent>
2626
<artifactId>application</artifactId>
@@ -229,9 +229,17 @@
229229
<groupId>com.google.protobuf</groupId>
230230
<artifactId>protobuf-java</artifactId>
231231
</dependency>
232+
<dependency>
233+
<groupId>io.netty</groupId>
234+
<artifactId>netty-all</artifactId>
235+
</dependency>
236+
<dependency>
237+
<groupId>io.netty</groupId>
238+
<artifactId>netty-tcnative-boringssl-static</artifactId>
239+
</dependency>
232240
<dependency>
233241
<groupId>io.grpc</groupId>
234-
<artifactId>grpc-netty</artifactId>
242+
<artifactId>grpc-netty-shaded</artifactId>
235243
</dependency>
236244
<dependency>
237245
<groupId>io.grpc</groupId>
@@ -262,17 +270,6 @@
262270
<artifactId>rest-client</artifactId>
263271
<scope>test</scope>
264272
</dependency>
265-
<dependency>
266-
<groupId>org.springframework.boot</groupId>
267-
<artifactId>spring-boot-starter-test</artifactId>
268-
<scope>test</scope>
269-
<exclusions>
270-
<exclusion>
271-
<groupId>com.vaadin.external.google</groupId>
272-
<artifactId>android-json</artifactId>
273-
</exclusion>
274-
</exclusions>
275-
</dependency>
276273
<dependency>
277274
<groupId>org.springframework.security</groupId>
278275
<artifactId>spring-security-test</artifactId>
@@ -289,18 +286,18 @@
289286
<scope>test</scope>
290287
</dependency>
291288
<dependency>
292-
<groupId>junit</groupId>
293-
<artifactId>junit</artifactId>
289+
<groupId>org.springframework.boot</groupId>
290+
<artifactId>spring-boot-starter-test</artifactId>
294291
<scope>test</scope>
295292
</dependency>
296293
<dependency>
297-
<groupId>org.awaitility</groupId>
298-
<artifactId>awaitility</artifactId>
294+
<groupId>org.junit.vintage</groupId>
295+
<artifactId>junit-vintage-engine</artifactId>
299296
<scope>test</scope>
300297
</dependency>
301298
<dependency>
302-
<groupId>org.mockito</groupId>
303-
<artifactId>mockito-core</artifactId>
299+
<groupId>org.awaitility</groupId>
300+
<artifactId>awaitility</artifactId>
304301
<scope>test</scope>
305302
</dependency>
306303
<dependency>
@@ -316,6 +313,7 @@
316313
<dependency>
317314
<groupId>org.hsqldb</groupId>
318315
<artifactId>hsqldb</artifactId>
316+
<scope>test</scope>
319317
</dependency>
320318
<dependency>
321319
<groupId>org.javadelight</groupId>

application/src/main/data/json/system/widget_bundles/cards.json

Lines changed: 18 additions & 0 deletions
Large diffs are not rendered by default.

application/src/main/data/json/system/widget_bundles/charts.json

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

application/src/main/data/json/system/widget_bundles/input_widgets.json

Lines changed: 33 additions & 33 deletions
Large diffs are not rendered by default.

application/src/main/data/json/system/widget_bundles/maps.json

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,14 @@ public void printStats() {
400400
@Getter
401401
private String debugPerTenantLimitsConfiguration;
402402

403+
@Value("${actors.rpc.sequential:false}")
404+
@Getter
405+
private boolean rpcSequential;
406+
407+
@Value("${actors.rpc.max_retries:5}")
408+
@Getter
409+
private int maxRpcRetries;
410+
403411
@Getter
404412
@Setter
405413
private TbActorSystem actorSystem;
@@ -478,7 +486,6 @@ public TopicPartitionInfo resolve(ServiceType serviceType, String queueName, Ten
478486
return partitionService.resolve(serviceType, queueName, tenantId, entityId);
479487
}
480488

481-
482489
public String getServiceId() {
483490
return serviceInfoProvider.getServiceId();
484491
}

application/src/main/java/org/thingsboard/server/actors/device/DeviceActorMessageProcessor.java

Lines changed: 118 additions & 56 deletions
Large diffs are not rendered by default.

application/src/main/java/org/thingsboard/server/actors/device/ToDeviceRpcRequestMetadata.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@
2525
public class ToDeviceRpcRequestMetadata {
2626
private final ToDeviceRpcRequestActorMsg msg;
2727
private final boolean sent;
28+
private int retries;
29+
private boolean delivered;
2830
}

application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainActorMessageProcessor.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,17 @@ private void onTellNext(TbMsg msg, RuleNodeId originatorNodeId, Set<String> rela
250250
checkActive(msg);
251251
EntityId entityId = msg.getOriginator();
252252
TopicPartitionInfo tpi = systemContext.resolve(ServiceType.TB_RULE_ENGINE, msg.getQueueName(), tenantId, entityId);
253-
List<RuleNodeRelation> relations = nodeRoutes.get(originatorNodeId).stream()
253+
254+
List<RuleNodeRelation> ruleNodeRelations = nodeRoutes.get(originatorNodeId);
255+
if (ruleNodeRelations == null) { // When unchecked, this will cause NullPointerException when rule node doesn't exist anymore
256+
log.warn("[{}][{}][{}] No outbound relations (null). Probably rule node does not exist. Probably old message.", tenantId, entityId, msg.getId());
257+
ruleNodeRelations = Collections.emptyList();
258+
}
259+
260+
List<RuleNodeRelation> relationsByTypes = ruleNodeRelations.stream()
254261
.filter(r -> contains(relationTypes, r.getType()))
255262
.collect(Collectors.toList());
256-
int relationsCount = relations.size();
263+
int relationsCount = relationsByTypes.size();
257264
if (relationsCount == 0) {
258265
log.trace("[{}][{}][{}] No outbound relations to process", tenantId, entityId, msg.getId());
259266
if (relationTypes.contains(TbRelationTypes.FAILURE)) {
@@ -268,21 +275,22 @@ private void onTellNext(TbMsg msg, RuleNodeId originatorNodeId, Set<String> rela
268275
msg.getCallback().onSuccess();
269276
}
270277
} else if (relationsCount == 1) {
271-
for (RuleNodeRelation relation : relations) {
278+
for (RuleNodeRelation relation : relationsByTypes) {
272279
log.trace("[{}][{}][{}] Pushing message to single target: [{}]", tenantId, entityId, msg.getId(), relation.getOut());
273280
pushToTarget(tpi, msg, relation.getOut(), relation.getType());
274281
}
275282
} else {
276283
MultipleTbQueueTbMsgCallbackWrapper callbackWrapper = new MultipleTbQueueTbMsgCallbackWrapper(relationsCount, msg.getCallback());
277-
log.trace("[{}][{}][{}] Pushing message to multiple targets: [{}]", tenantId, entityId, msg.getId(), relations);
278-
for (RuleNodeRelation relation : relations) {
284+
log.trace("[{}][{}][{}] Pushing message to multiple targets: [{}]", tenantId, entityId, msg.getId(), relationsByTypes);
285+
for (RuleNodeRelation relation : relationsByTypes) {
279286
EntityId target = relation.getOut();
280287
putToQueue(tpi, msg, callbackWrapper, target);
281288
}
282289
}
283290
} catch (RuleNodeException rne) {
284291
msg.getCallback().onFailure(rne);
285292
} catch (Exception e) {
293+
log.warn("[" + tenantId + "]" + "[" + entityId + "]" + "[" + msg.getId() + "]" + " onTellNext failure", e);
286294
msg.getCallback().onFailure(new RuleEngineException("onTellNext - " + e.getMessage()));
287295
}
288296
}

application/src/main/java/org/thingsboard/server/controller/AbstractRpcController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ protected DeferredResult<ResponseEntity> handleDeviceRPCRequest(boolean oneWay,
7575
SecurityUser currentUser = getCurrentUser();
7676
TenantId tenantId = currentUser.getTenantId();
7777
final DeferredResult<ResponseEntity> response = new DeferredResult<>();
78-
long timeout = rpcRequestBody.has("timeout") ? rpcRequestBody.get("timeout").asLong() : defaultTimeout;
79-
long expTime = System.currentTimeMillis() + Math.max(minTimeout, timeout);
78+
long timeout = rpcRequestBody.has(DataConstants.TIMEOUT) ? rpcRequestBody.get(DataConstants.TIMEOUT).asLong() : defaultTimeout;
79+
long expTime = rpcRequestBody.has(DataConstants.EXPIRATION_TIME) ? rpcRequestBody.get(DataConstants.EXPIRATION_TIME).asLong() : System.currentTimeMillis() + Math.max(minTimeout, timeout);
8080
UUID rpcRequestUUID = rpcRequestBody.has("requestUUID") ? UUID.fromString(rpcRequestBody.get("requestUUID").asText()) : UUID.randomUUID();
8181
boolean persisted = rpcRequestBody.has(DataConstants.PERSISTENT) && rpcRequestBody.get(DataConstants.PERSISTENT).asBoolean();
8282
String additionalInfo = JacksonUtil.toString(rpcRequestBody.get(DataConstants.ADDITIONAL_INFO));
83+
Integer retries = rpcRequestBody.has(DataConstants.RETRIES) ? rpcRequestBody.get(DataConstants.RETRIES).asInt() : null;
8384
accessValidator.validate(currentUser, Operation.RPC_CALL, deviceId, new HttpValidationCallback(response, new FutureCallback<>() {
8485
@Override
8586
public void onSuccess(@Nullable DeferredResult<ResponseEntity> result) {
@@ -90,6 +91,7 @@ public void onSuccess(@Nullable DeferredResult<ResponseEntity> result) {
9091
expTime,
9192
body,
9293
persisted,
94+
retries,
9395
additionalInfo
9496
);
9597
deviceRpcService.processRestApiRpcRequest(rpcRequest, fromDeviceRpcResponse -> reply(new LocalRequestMetaData(rpcRequest, currentUser, result), fromDeviceRpcResponse, timeoutStatus, noActiveConnectionStatus), currentUser);

0 commit comments

Comments
 (0)