Skip to content

Commit

Permalink
[ISSUE apache#7979] Fix timerWheel message metric (apache#7980)
Browse files Browse the repository at this point in the history
* fix metric in TimerWheel

* fix metric in TimerWheel

* fix message metric in TimerWheel

* fix message metric in TimerWheel
  • Loading branch information
3424672656 authored Apr 1, 2024
1 parent 28565a3 commit bf24ffd
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,8 @@ public void run() {
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();
Expand All @@ -1566,6 +1568,8 @@ public void run() {
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);
Expand Down

0 comments on commit bf24ffd

Please sign in to comment.