aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHÃ¥kon Hallingstad <hakon@verizonmedia.com>2020-12-07 14:16:37 +0100
committerGitHub <noreply@github.com>2020-12-07 14:16:37 +0100
commit0940399984332d38a21d3f71ed0bf8d504e5ee99 (patch)
treeac9ad8b47d8bcf95ece21b7e0d7871f460071814
parentc8b8988ee986fa0a08274aa8ef12b7fbddd90488 (diff)
parent411e231995bc07962a7693a9a936fb39f5810ad1 (diff)
Merge pull request #15717 from vespa-engine/revert-15596-hakonhall/simplify-symlink
Revert "Simplify symlink"
-rw-r--r--container-accesslogging/src/main/java/com/yahoo/container/logging/LogFileHandler.java9
-rw-r--r--zkfacade/src/main/java/com/yahoo/vespa/curator/stats/LatencyMetrics.java2
2 files changed, 9 insertions, 2 deletions
diff --git a/container-accesslogging/src/main/java/com/yahoo/container/logging/LogFileHandler.java b/container-accesslogging/src/main/java/com/yahoo/container/logging/LogFileHandler.java
index 75e9febc192..ab246a21a43 100644
--- a/container-accesslogging/src/main/java/com/yahoo/container/logging/LogFileHandler.java
+++ b/container-accesslogging/src/main/java/com/yahoo/container/logging/LogFileHandler.java
@@ -298,7 +298,14 @@ public class LogFileHandler extends StreamHandler {
if (symlinkName == null) return;
File f = new File(fileName);
File f2 = new File(f.getParent(), symlinkName);
- String [] cmd = new String[]{"/bin/ln", "-sf", f.getName(), f2.getPath()};
+ String canonicalPath;
+ try {
+ canonicalPath = f.getCanonicalPath();
+ } catch (IOException e) {
+ logger.warning("Got '" + e + "' while doing f.getCanonicalPath() on file '" + f.getPath() + "'.");
+ return;
+ }
+ String [] cmd = new String[]{"/bin/ln", "-sf", canonicalPath, f2.getPath()};
try {
int retval = new ProcessExecuter().exec(cmd).getFirst();
// Detonator pattern: Think of all the fun we can have if ln isn't what we
diff --git a/zkfacade/src/main/java/com/yahoo/vespa/curator/stats/LatencyMetrics.java b/zkfacade/src/main/java/com/yahoo/vespa/curator/stats/LatencyMetrics.java
index 3bfb1fca4d9..22af158faa9 100644
--- a/zkfacade/src/main/java/com/yahoo/vespa/curator/stats/LatencyMetrics.java
+++ b/zkfacade/src/main/java/com/yahoo/vespa/curator/stats/LatencyMetrics.java
@@ -77,6 +77,6 @@ public class LatencyMetrics {
'}';
}
- private double secondsWithMillis(Duration duration) { return duration.toMillis() / 1000.0; }
+ private double secondsWithMillis(Duration duration) { return round(duration.toMillis()) / 1000.0; }
private double roundTo3DecimalPlaces(double value) { return round(value * 1000) / 1000.0; }
}