[ISSUE #7979] Fix timerWheel message metric (#7980)

* fix metric in TimerWheel

* fix metric in TimerWheel

* fix message metric in TimerWheel

* fix message metric in TimerWheel
This commit is contained in:
hqbfz
2024-04-01 10:47:35 +08:00
committed by GitHub
parent 28565a34a4
commit bf24ffde88
@@ -1556,6 +1556,8 @@ public class TimerMessageStore {
if (null != msgExt) {
if (needDelete(tr.getMagic()) && !needRoll(tr.getMagic())) {
if (msgExt.getProperty(MessageConst.PROPERTY_TIMER_DEL_UNIQKEY) != null && tr.getDeleteList() != null) {
//Execute metric plus one for messages that fail to be deleted
addMetric(msgExt, 1);
tr.getDeleteList().add(msgExt.getProperty(MessageConst.PROPERTY_TIMER_DEL_UNIQKEY));
}
tr.idempotentRelease();
@@ -1566,6 +1568,8 @@ public class TimerMessageStore {
LOGGER.warn("No uniqueKey for msg:{}", msgExt);
}
if (null != uniqueKey && tr.getDeleteList() != null && tr.getDeleteList().size() > 0 && tr.getDeleteList().contains(uniqueKey)) {
//Normally, it cancels out with the +1 above
addMetric(msgExt, -1);
doRes = true;
tr.idempotentRelease();
perfCounterTicks.getCounter("dequeue_delete").flow(1);