Caideyipi opened a new pull request, #18350:
URL: https://github.com/apache/iotdb/pull/18350

   ## Description
   
   ### Problem
   
   When `TsFileInsertionEventScanParser` reached EOF while producing the final 
tablet, `prepareData()` closed the parser immediately. The iterator then tried 
to release the parser-side tablet memory in its `finally` block, which called 
`forceResize(0)` on an already released memory block and could continuously 
emit `forceResize: cannot resize a null or released memory block` warnings.
   
   ### Changes
   
   - Defer parser close at EOF until after the final tablet memory accounting 
is released.
   - Keep immediate cleanup in the constructor when a TsFile contains no tablet 
data.
   - Strengthen the parser unit test to verify that tablet memory usage is zero 
before its block is closed.
   
   ### Tests
   
   - `mvn spotless:apply -pl iotdb-core/datanode`
   - `mvn -pl iotdb-core/datanode -Dtest=TsFileInsertionEventParserTest test` 
(21 tests, 0 failures, 3 skipped)
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added comments explaining the why and intent of the non-obvious close 
ordering.
   - [x] modified an existing unit test to cover the regression.
   
   <hr>
   
   ##### Key changed/added classes
   
   - `TsFileInsertionEventScanParser`
   - `TsFileInsertionEventParserTest`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to