mirror of
https://github.com/apache/rocketmq.git
synced 2026-09-18 17:13:50 +08:00
[ISSUE #6518] Fix bug that multi-threaded using bytebuffer
Co-authored-by: guyinyou <guyinyou.gyy@alibaba-inc.com>
This commit is contained in:
@@ -2885,7 +2885,7 @@ public class DefaultMessageStore implements MessageStore {
|
||||
BatchDispatchRequest task = batchDispatchRequestQueue.peek();
|
||||
batchDispatchRequestExecutor.execute(() -> {
|
||||
try {
|
||||
ByteBuffer tmpByteBuffer = task.byteBuffer.duplicate();
|
||||
ByteBuffer tmpByteBuffer = task.byteBuffer;
|
||||
tmpByteBuffer.position(task.position);
|
||||
tmpByteBuffer.limit(task.position + task.size);
|
||||
List<DispatchRequest> dispatchRequestList = new ArrayList<>();
|
||||
@@ -3018,7 +3018,7 @@ public class DefaultMessageStore implements MessageStore {
|
||||
return;
|
||||
}
|
||||
mappedPageHoldCount.getAndIncrement();
|
||||
BatchDispatchRequest task = new BatchDispatchRequest(byteBuffer, position, size, batchId++);
|
||||
BatchDispatchRequest task = new BatchDispatchRequest(byteBuffer.duplicate(), position, size, batchId++);
|
||||
batchDispatchRequestQueue.offer(task);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user