[
https://issues.apache.org/jira/browse/IOTDB-406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17010892#comment-17010892
]
Xiangdong Huang commented on IOTDB-406:
---------------------------------------
Hm, I find some file writers are not closed...
especially for ModificationFiles..
Now, the file open and file close are in different functions, and the close()
function may be called in an async way. So, be careful for programming.
TODO: For mergingModification in StorageGroupProcessor (SGP), it is closed only
after the merging task is finished.
# Can we close it once before the merging task starts?
# Be careful if we call EnvironmentUtils.cleanEnv, MergeManager may be stopped
in force, and thereby some mergingModifications are not closed.
[~jt2594838], you'd better have a review.
Besides, for StorageGroupProcessor (SGP), notice if you want to remove a SGP
out of memory, (for example, in [~SilverNarcissus]'s PR for supporting SG time
partition, a SGP with an stale time partition may be cleaned from memory), do
not forget to close the corresponding LogFile (now, if a memtable is flushed,
the corresponding logfile will be closed), and close all the mod files in this
SGP with the time partition (now, the mod files in sequneceFileList and
unsequenceFileList are only closed if some call deleteFiles() in SGP, which is
just for test. That is, no body close these mod files..).
I add a function called closeAllResources() in SGP, you can use it if you want
to remove SGP from processorMap of StorageEngine. [~SilverNarcissus].
> Refactor EnvironmentUtils for closing IoTDB timely in Integration Tests
> -----------------------------------------------------------------------
>
> Key: IOTDB-406
> URL: https://issues.apache.org/jira/browse/IOTDB-406
> Project: Apache IoTDB
> Issue Type: Task
> Reporter: Xiangdong Huang
> Assignee: Rui Liu
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Currently, we usually occurs that in some ITs, the IoTDB daemon is not closed
> in previous tests.
> Besides, IoTDB daemon is not needed to exposed to IT classes.
> Therefore, I'd like to refactor the EnvironmentUtils class.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)