YARN-3919. NPEs' while stopping service after exception during CommonNodeLabelsManager#start. (varun saxena via rohithsharmaks)

This commit is contained in:
rohithsharmaks 2015-07-29 23:44:15 +05:30
parent 8659315062
commit 9c00ae0009
3 changed files with 7 additions and 7 deletions

View File

@ -655,6 +655,9 @@ Release 2.8.0 - UNRELEASED
YARN-3982. container-executor parsing of container-executor.cfg broken in
trunk and branch-2. (Varun Vasudev via xgong)
YARN-3919. NPEs' while stopping service after exception during
CommonNodeLabelsManager#start. (varun saxane via rohithsharmaks)
Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -139,7 +139,8 @@ protected void serviceStop() throws Exception {
blockNewEvents = true;
LOG.info("AsyncDispatcher is draining to stop, igonring any new events.");
synchronized (waitForDrained) {
while (!drained && eventHandlingThread.isAlive()) {
while (!drained && eventHandlingThread != null
&& eventHandlingThread.isAlive()) {
waitForDrained.wait(1000);
LOG.info("Waiting for AsyncDispatcher to drain. Thread state is :" +
eventHandlingThread.getState());

View File

@ -33,6 +33,7 @@
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.yarn.api.records.NodeId;
import org.apache.hadoop.yarn.api.records.NodeLabel;
@ -92,12 +93,7 @@ public void init(Configuration conf) throws Exception {
@Override
public void close() throws IOException {
try {
fs.close();
editlogOs.close();
} catch (IOException e) {
LOG.warn("Exception happened whiling shutting down,", e);
}
IOUtils.cleanup(LOG, fs, editlogOs);
}
private void setFileSystem(Configuration conf) throws IOException {