Skip to content

Commit 09017af

Browse files
authored
Pipe: Fixed the NPE of progress report event (#17474)
1 parent d44046c commit 09017af

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/dataregion/realtime/PipeRealtimeDataRegionSource.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,11 @@ protected void extractProgressReportEvent(final PipeRealtimeEvent event) {
431431
// Since the batch and retry queue no longer need the heartbeat event to trigger
432432
// And the progress report event can trigger the processor calculation because it's not reported
433433
// yet
434-
while (((PipeRealtimeEvent) pendingQueue.peekLast()).getEvent() instanceof PipeHeartbeatEvent) {
434+
while (true) {
435+
final PipeRealtimeEvent lastEvent = ((PipeRealtimeEvent) pendingQueue.peekLast());
436+
if (lastEvent == null || !(lastEvent.getEvent() instanceof PipeHeartbeatEvent)) {
437+
break;
438+
}
435439
pendingQueue.pollLast();
436440
}
437441
if (pendingQueue.peekLast() instanceof ProgressReportEvent) {

0 commit comments

Comments
 (0)