JackieTien97 opened a new pull request, #16274: URL: https://github.com/apache/iotdb/pull/16274
This pull request improves the robustness of the `tryGetFLushLock` method in `DataRegion.java` by handling cases where a `TsFileProcessor` is null, which indicates the file is in the process of closing. The new logic introduces a busy-wait loop to check for the file's closed status before proceeding, ensuring thread safety and correctness during concurrent file operations. **Concurrency and file closing handling:** * Added a check for `tsFileProcessor == null` to detect if a tsfile is being closed, and implemented a busy-wait loop that waits for the file to finish closing before proceeding. If the file closes within the wait time, the loop continues; otherwise, it clears the lock list and returns `false` to prevent unsafe operations. (`iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java`) -- 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]
