Skip to content

Commit fb86a96

Browse files
authored
Pipe: Fix the problem that the Pipe memory block fails to call the Wait function (#15687)
1 parent 54afc3b commit fb86a96

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/batch/PipeTabletEventBatch.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ protected PipeTabletEventBatch(final int maxDelayInMs, final long requestMaxBatc
6060

6161
// limit in buffer size
6262
this.allocatedMemoryBlock =
63-
pipeModelFixedMemoryBlock =
64-
PipeDataNodeResourceManager.memory()
65-
.forceAllocateForModelFixedMemoryBlock(
66-
requestMaxBatchSizeInBytes, PipeMemoryBlockType.BATCH);
63+
PipeDataNodeResourceManager.memory()
64+
.forceAllocateForModelFixedMemoryBlock(
65+
requestMaxBatchSizeInBytes, PipeMemoryBlockType.BATCH);
6766

6867
if (getMaxBatchSizeInBytes() != requestMaxBatchSizeInBytes) {
6968
LOGGER.info(

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/PipeMemoryManager.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ public PipeModelFixedMemoryBlock forceAllocateForModelFixedMemoryBlock(
262262
}
263263
}
264264

265-
if (getFreeMemorySizeInBytes() < fixedSizeInBytes) {
266-
return (PipeModelFixedMemoryBlock) forceAllocateWithRetry(getFreeMemorySizeInBytes(), type);
267-
}
268-
269265
synchronized (this) {
266+
if (getFreeMemorySizeInBytes() < fixedSizeInBytes) {
267+
return (PipeModelFixedMemoryBlock) forceAllocateWithRetry(getFreeMemorySizeInBytes(), type);
268+
}
269+
270270
return (PipeModelFixedMemoryBlock) forceAllocateWithRetry(fixedSizeInBytes, type);
271271
}
272272
}

0 commit comments

Comments
 (0)