Skip to content

Commit

Permalink
Fix delete data TsFileProcessor NPE (#14748)
Browse files Browse the repository at this point in the history
  • Loading branch information
HTHou authored Jan 22, 2025
1 parent 3491493 commit 9be5eeb
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2505,17 +2505,22 @@ private void deleteDataInUnsealedFiles(
if (tsFileResource.isClosed()) {
sealedTsFiles.add(tsFileResource);
} else {
tsFileResource.getProcessor().getFlushQueryLock().writeLock().lock();
if (tsFileResource.isClosed()) {
TsFileProcessor tsFileProcessor = tsFileResource.getProcessor();
if (tsFileProcessor == null) {
sealedTsFiles.add(tsFileResource);
tsFileResource.getProcessor().getFlushQueryLock().writeLock().unlock();
} else {
try {
if (!tsFileResource.getProcessor().deleteDataInMemory(deletion)) {
sealedTsFiles.add(tsFileResource);
} // else do nothing
} finally {
tsFileResource.getProcessor().getFlushQueryLock().writeLock().unlock();
tsFileProcessor.getFlushQueryLock().writeLock().lock();
if (tsFileResource.isClosed()) {
sealedTsFiles.add(tsFileResource);
tsFileProcessor.getFlushQueryLock().writeLock().unlock();
} else {
try {
if (!tsFileProcessor.deleteDataInMemory(deletion)) {
sealedTsFiles.add(tsFileResource);
} // else do nothing
} finally {
tsFileProcessor.getFlushQueryLock().writeLock().unlock();
}
}
}
}
Expand Down

0 comments on commit 9be5eeb

Please sign in to comment.