Skip to content

Commit

Permalink
事务消息, 回查判断OP_HALF_QUEUE 消息是否在HALF_QUEUE中,优化判断方式。
Browse files Browse the repository at this point in the history
Transaction message, check back to determine if the OP-HALF-QUEUE message is in HALF-QUEUE, optimize the judgment method
  • Loading branch information
TangJie committed Dec 18, 2024
1 parent 93e2689 commit 72ac17b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ public void check(long transactionTimeout, int transactionCheckMax,
long nextOpOffset = pullResult.getNextBeginOffset();
int putInQueueCount = 0;
int escapeFailCnt = 0;
Long removedOpOffset;

while (true) {
if (System.currentTimeMillis() - startTime > MAX_PROCESS_TIME_LIMIT) {
log.info("Queue={} process time reach max={}", messageQueue, MAX_PROCESS_TIME_LIMIT);
break;
}
if (removeMap.containsKey(i)) {
if ((removedOpOffset = removeMap.remove(i)) != null) {
log.debug("Half offset {} has been committed/rolled back", i);
Long removedOpOffset = removeMap.remove(i);
opMsgMap.get(removedOpOffset).remove(i);
if (opMsgMap.get(removedOpOffset).size() == 0) {
opMsgMap.remove(removedOpOffset);
Expand Down

0 comments on commit 72ac17b

Please sign in to comment.