priyeshkaratha commented on code in PR #9039:
URL: https://github.com/apache/ozone/pull/9039#discussion_r2354566158
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBStoreBuilder.java:
##########
@@ -207,24 +207,30 @@ public RDBStore build() throws RocksDatabaseException {
}
Set<TableConfig> tableConfigs = makeTableConfigs();
-
+ ManagedWriteOptions writeOptions = null;
try {
if (rocksDBOption == null) {
rocksDBOption = getDefaultDBOptions(tableConfigs);
}
setDBOptionsProps(rocksDBOption);
- ManagedWriteOptions writeOptions = new ManagedWriteOptions();
- writeOptions.setSync(rocksDBConfiguration.getSyncOption());
-
File dbFile = getDBFile();
if (!dbFile.getParentFile().exists()) {
throw new RocksDatabaseException("The DB destination directory should
exist.");
}
+ writeOptions = new ManagedWriteOptions();
+ writeOptions.setSync(rocksDBConfiguration.getSyncOption());
return new RDBStore(dbFile, rocksDBOption, statistics, writeOptions,
tableConfigs,
openReadOnly, dbJmxBeanNameName, enableCompactionDag,
maxDbUpdatesSizeThreshold, createCheckpointDirs, configuration,
enableRocksDbMetrics);
+ } catch (Exception ex) {
+ try {
+ writeOptions.close();
Review Comment:
Thanks for the catch. Its resolved.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]