Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2560,8 +2560,12 @@ private RemotingCommand queryCorrectionOffset(ChannelHandlerContext ctx,
if (compareOffset != null && !compareOffset.isEmpty()) {
for (Map.Entry<Integer, Long> entry : compareOffset.entrySet()) {
Integer queueId = entry.getKey();
correctionOffset.put(queueId,
correctionOffset.get(queueId) > entry.getValue() ? Long.MAX_VALUE : correctionOffset.get(queueId));
Long minOffset = correctionOffset.get(queueId);
// correctionOffset only contains queueIds present in the topic's offset table;
// skip queueIds the compare group has but no other group consumed.
if (minOffset != null) {
correctionOffset.put(queueId, minOffset > entry.getValue() ? Long.MAX_VALUE : minOffset);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public void check(long transactionTimeout, int transactionCheckMax,
}
List<MessageExt> opMsg = pullResult == null ? null : pullResult.getMsgFoundList();
boolean isNeedCheck = opMsg == null && valueOfCurrentMinusBorn > checkImmunityTime
|| opMsg != null && opMsg.get(opMsg.size() - 1).getBornTimestamp() - startTime > transactionTimeout
|| opMsg != null && !opMsg.isEmpty() && opMsg.get(opMsg.size() - 1).getBornTimestamp() - startTime > transactionTimeout
|| valueOfCurrentMinusBorn <= -1;

if (isNeedCheck) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.rocketmq.common.utils;

import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
Expand Down Expand Up @@ -49,7 +50,8 @@ static public HttpResult httpGet(String url, List<String> headers, List<String>
if (HttpURLConnection.HTTP_OK == respCode) {
resp = IOTinyUtils.toString(conn.getInputStream(), encoding);
} else {
resp = IOTinyUtils.toString(conn.getErrorStream(), encoding);
InputStream errorStream = conn.getErrorStream();
resp = errorStream == null ? null : IOTinyUtils.toString(errorStream, encoding);
}
return new HttpResult(respCode, resp);
} finally {
Expand Down Expand Up @@ -114,7 +116,8 @@ static public HttpResult httpPost(String url, List<String> headers, List<String>
if (HttpURLConnection.HTTP_OK == respCode) {
resp = IOTinyUtils.toString(conn.getInputStream(), encoding);
} else {
resp = IOTinyUtils.toString(conn.getErrorStream(), encoding);
InputStream errorStream = conn.getErrorStream();
resp = errorStream == null ? null : IOTinyUtils.toString(errorStream, encoding);
}
return new HttpResult(respCode, resp);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,9 @@ public long estimateMessageCount(long from, long to, MessageFilter filter) {
ConsumeQueueExt.CqExtUnit ext = null;
if (isExtWriteEnable()) {
ext = consumeQueueExt.get(tagCode);
tagCode = ext.getTagsCode();
if (ext != null) {
tagCode = ext.getTagsCode();
}
}
if (filter.isMatchedByConsumeQueue(tagCode, ext)) {
match++;
Expand Down