Skip to content
Snippets Groups Projects
Commit c586a0cd authored by Stephan Wahlbrink's avatar Stephan Wahlbrink
Browse files

[RJ-Servi] Add catch of all throwables when cleaning up node resourcers

Backport-of: 088b523a
Change-Id: I671fc207335992e29a171571757d950f1b15531e
parent 9e73a232
No related branches found
No related tags found
No related merge requests found
......@@ -685,21 +685,33 @@ public class LocalNodeFactory implements NodeFactory {
}
}
if (!this.verbose && handler.dir != null
&& handler.dir.exists() && handler.dir.isDirectory() ) {
for (int i= 0; i < 20; i++) {
try {
Thread.sleep(200);
}
catch (final InterruptedException e) {
}
if (!handler.dir.exists() || ServerUtils.delDir(handler.dir)) {
return;
if (!this.verbose && handler.dir != null) {
cleanupNode(handler);
}
}
private void cleanupNode(final NodeHandler handler) {
Throwable deleteException= null;
try {
if (handler.dir.exists() && handler.dir.isDirectory()) {
for (int i= 0; i < 20; i++) {
try {
Thread.sleep(200);
}
catch (final InterruptedException e) {
}
if (!handler.dir.exists() || ServerUtils.delDir(handler.dir)) {
return;
}
}
}
Utils.logWarning("Failed to delete the RServi node working directory '" + handler.dir.toString() + "'.");
}
catch (final Throwable e) {
deleteException= e;
}
Utils.logWarning("Failed to delete the RServi node working directory '" + handler.dir.toString() + "'.",
deleteException );
}
}
......@@ -176,7 +176,7 @@ public class Utils {
CommonsRuntime.log(new WarningStatus(RServiUtils.RJ_SERVI_ID, message));
}
public static void logWarning(final String message, final Throwable e) {
public static void logWarning(final String message, final @Nullable Throwable e) {
CommonsRuntime.log(new WarningStatus(RServiUtils.RJ_SERVI_ID, message, e));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment