8057732: sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java: Invalid PerfMemory size
authorgadams
Mon, 26 Mar 2018 08:17:56 -0400
changeset 49610 6790b1077a3f
parent 49609 cc63a8331f91
child 49611 973c9504178e
8057732: sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java: Invalid PerfMemory size Reviewed-by: cjplummer
src/jdk.attach/windows/classes/sun/tools/attach/VirtualMachineImpl.java
test/jdk/ProblemList.txt
--- a/src/jdk.attach/windows/classes/sun/tools/attach/VirtualMachineImpl.java	Mon Mar 26 09:27:24 2018 -0700
+++ b/src/jdk.attach/windows/classes/sun/tools/attach/VirtualMachineImpl.java	Mon Mar 26 08:17:56 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -80,9 +80,19 @@
         assert args.length <= 3;        // includes null
 
         // create a pipe using a random name
-        int r = (new Random()).nextInt();
-        String pipename = "\\\\.\\pipe\\javatool" + r;
-        long hPipe = createPipe(pipename);
+        Random rnd = new Random();
+        int r = rnd.nextInt();
+        String pipeprefix = "\\\\.\\pipe\\javatool";
+        String pipename = pipeprefix + r;
+        long hPipe;
+        try {
+            hPipe = createPipe(pipename);
+        } catch (IOException ce) {
+            // Retry with another random pipe name.
+            r = rnd.nextInt();
+            pipename = pipeprefix + r;
+            hPipe = createPipe(pipename);
+        }
 
         // check if we are detached - in theory it's possible that detach is invoked
         // after this check but before we enqueue the command.
--- a/test/jdk/ProblemList.txt	Mon Mar 26 09:27:24 2018 -0700
+++ b/test/jdk/ProblemList.txt	Mon Mar 26 08:17:56 2018 -0400
@@ -768,7 +768,6 @@
 
 sun/tools/jstat/jstatClassloadOutput1.sh                        8173942 generic-all
 
-sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java    8057732 generic-all
 
 ############################################################################