Skip to content
Permalink
Browse files
8255908: ExceptionInInitializerError due to UncheckedIOException whil…
…e initializing cgroupv1 subsystem

Reviewed-by: yan
Backport-of: 8d9cf48
  • Loading branch information
Ekaterina Vergizova authored and Yuri Nesterenko committed Jan 27, 2021
1 parent b070099 commit 9be352b3b6bde40ce8100142b8342247b1136db3
@@ -26,6 +26,7 @@
package jdk.internal.platform.cgroupv1;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -84,6 +85,8 @@ private static Metrics initContainerSubSystems() {

} catch (IOException e) {
return null;
} catch (UncheckedIOException e) {
return null;
}

/**
@@ -118,6 +121,8 @@ private static Metrics initContainerSubSystems() {

} catch (IOException e) {
return null;
} catch (UncheckedIOException e) {
return null;
}

// Return Metrics object if we found any subsystems.
@@ -135,6 +140,8 @@ private static Metrics initContainerSubSystems() {
} catch (PrivilegedActionException e) {
unwrapIOExceptionAndRethrow(e);
throw new InternalError(e.getCause());
} catch (UncheckedIOException e) {
throw e.getCause();
}
}

@@ -27,6 +27,7 @@

import java.io.BufferedReader;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.math.BigInteger;
import java.nio.file.Files;
import java.nio.file.Paths;
@@ -110,6 +111,8 @@ private String readStringValue(String param) throws IOException {
} catch (PrivilegedActionException e) {
Metrics.unwrapIOExceptionAndRethrow(e);
throw new InternalError(e.getCause());
} catch (UncheckedIOException e) {
throw e.getCause();
}
}

@@ -140,6 +143,8 @@ public static long getLongValueMatchingLine(SubSystem subsystem,
} catch (PrivilegedActionException e) {
Metrics.unwrapIOExceptionAndRethrow(e);
throw new InternalError(e.getCause());
} catch (UncheckedIOException e) {
throw e.getCause();
}
}

@@ -202,8 +207,9 @@ public static long getLongEntry(SubSystem subsystem, String parm, String entryna
.findFirst();

return result.isPresent() ? Long.parseLong(result.get()) : 0L;
}
catch (IOException e) {
} catch (IOException e) {
return 0L;
} catch (UncheckedIOException e) {
return 0L;
}
}

1 comment on commit 9be352b

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 9be352b Jan 27, 2021

Please sign in to comment.