Browse Source

Merge pull request #9818 from smatvienko-tb/fix/TbSqlBlockingQueue_does_not_log_an_error_on_InterruptedException_because_of_normal_lifecycle_

[3.6.2] TbSqlBlockingQueue does not log an error on InterruptedException because of normal lifecycle
pull/9824/head
Andrew Shvayka 3 years ago
committed by GitHub
parent
commit
64e330b330
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      dao/src/main/java/org/thingsboard/server/dao/sql/TbSqlBlockingQueue.java

3
dao/src/main/java/org/thingsboard/server/dao/sql/TbSqlBlockingQueue.java

@ -84,7 +84,6 @@ public class TbSqlBlockingQueue<E> implements TbSqlQueue<E> {
}
}
} catch (Throwable t) {
log.error("[{}] Failed to save {} entities", logName, entities.size(), t);
try {
stats.incrementFailed(entities.size());
entities.forEach(entityFutureWrapper -> entityFutureWrapper.getFuture().setException(t));
@ -94,6 +93,8 @@ public class TbSqlBlockingQueue<E> implements TbSqlQueue<E> {
if (t instanceof InterruptedException) {
log.info("[{}] Queue polling was interrupted", logName);
break;
} else {
log.error("[{}] Failed to save {} entities", logName, entities.size(), t);
}
} finally {
entities.clear();

Loading…
Cancel
Save