BurstTbRuleEngineSubmitStrategy debug notes to fix the long-running testTheCopyOfAttrsIntoTSForTheView

This commit is contained in:
Sergey Matvienko 2022-04-19 13:03:45 +03:00
parent b3a20fb2b0
commit 1600fa7f65
3 changed files with 11 additions and 0 deletions

View File

@ -33,6 +33,7 @@ public class BurstTbRuleEngineSubmitStrategy extends AbstractTbRuleEngineSubmitS
public void submitAttempt(BiConsumer<UUID, TbProtoQueueMsg<TransportProtos.ToRuleEngineMsg>> msgConsumer) { public void submitAttempt(BiConsumer<UUID, TbProtoQueueMsg<TransportProtos.ToRuleEngineMsg>> msgConsumer) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("[{}] submitting [{}] messages to rule engine", queueName, orderedMsgList.size()); log.debug("[{}] submitting [{}] messages to rule engine", queueName, orderedMsgList.size());
orderedMsgList.forEach((pair)->log.trace("submitted uuid {}, msg {}", pair.uuid, pair.msg));
} }
orderedMsgList.forEach(pair -> msgConsumer.accept(pair.uuid, pair.msg)); orderedMsgList.forEach(pair -> msgConsumer.accept(pair.uuid, pair.msg));
} }

View File

@ -16,6 +16,9 @@
<logger name="org.cassandraunit" level="INFO"/> <logger name="org.cassandraunit" level="INFO"/>
<logger name="org.eclipse.leshan" level="INFO"/> <logger name="org.eclipse.leshan" level="INFO"/>
<logger name="org.thingsboard.server.actors.service.ContextAwareActor" level="TRACE"/>
<logger name="org.thingsboard.server.service.queue.processing.BurstTbRuleEngineSubmitStrategy" level="TRACE"/>
<logger name="org.thingsboard.server.service.queue.TbMsgPackCallback" level="TRACE"/>
<root level="WARN"> <root level="WARN">
<appender-ref ref="console"/> <appender-ref ref="console"/>

View File

@ -141,6 +141,7 @@ public final class TbActorMailbox implements TbActorCtx {
log.debug("[{}] Going to process message: {}", selfId, msg); log.debug("[{}] Going to process message: {}", selfId, msg);
actor.process(msg); actor.process(msg);
} catch (TbRuleNodeUpdateException updateException) { } catch (TbRuleNodeUpdateException updateException) {
log.debug("[{}] INIT_FAILED: {} {}", selfId, msg, updateException);
stopReason = TbActorStopReason.INIT_FAILED; stopReason = TbActorStopReason.INIT_FAILED;
destroy(); destroy();
} catch (Throwable t) { } catch (Throwable t) {
@ -155,6 +156,12 @@ public final class TbActorMailbox implements TbActorCtx {
break; break;
} }
} }
if (noMoreElements && (!normalPriorityMsgs.isEmpty() || !highPriorityMsgs.isEmpty())) {
log.error("noMoreElements=true, but mailbox is not empty!");
}
if (noMoreElements == false && (normalPriorityMsgs.isEmpty() && highPriorityMsgs.isEmpty())) {
log.error("noMoreElements=false, but mailbox is empty!");
}
if (noMoreElements) { if (noMoreElements) {
busy.set(FREE); busy.set(FREE);
dispatcher.getExecutor().execute(() -> tryProcessQueue(false)); dispatcher.getExecutor().execute(() -> tryProcessQueue(false));