YARN-2167. LeveldbIterator should get closed in NMLeveldbStateStoreService#loadLocalizationState() within finally block. Contributed by Junping Du
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1603039 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
072360d128
commit
98238a8d4a
@ -255,6 +255,10 @@ Release 2.5.0 - UNRELEASED
|
||||
to NMs where the completed applications previously ran in case of RM restart.
|
||||
(Wangda Tan via jianhe)
|
||||
|
||||
YARN-2167. LeveldbIterator should get closed in
|
||||
NMLeveldbStateStoreService#loadLocalizationState() within finally block
|
||||
(Junping Du via jlowe)
|
||||
|
||||
Release 2.4.1 - 2014-06-23
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
@ -95,8 +95,9 @@ public RecoveredLocalizationState loadLocalizationState()
|
||||
throws IOException {
|
||||
RecoveredLocalizationState state = new RecoveredLocalizationState();
|
||||
|
||||
LeveldbIterator iter = null;
|
||||
try {
|
||||
LeveldbIterator iter = new LeveldbIterator(db);
|
||||
iter = new LeveldbIterator(db);
|
||||
iter.seek(bytes(LOCALIZATION_PUBLIC_KEY_PREFIX));
|
||||
state.publicTrackerState = loadResourceTrackerState(iter,
|
||||
LOCALIZATION_PUBLIC_KEY_PREFIX);
|
||||
@ -122,6 +123,10 @@ public RecoveredLocalizationState loadLocalizationState()
|
||||
}
|
||||
} catch (DBException e) {
|
||||
throw new IOException(e.getMessage(), e);
|
||||
} finally {
|
||||
if (iter != null) {
|
||||
iter.close();
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
|
Loading…
Reference in New Issue
Block a user