src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java
branchJEP-349-branch
changeset 57752 7072cf06887a
parent 53013 c8b2a408628b
child 57858 9254b05c141c
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java	Wed Aug 14 20:34:11 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java	Thu Aug 15 02:51:20 2019 +0200
@@ -27,10 +27,13 @@
 
 
 
+import jdk.jfr.FlightRecorder;
 import jdk.jfr.internal.LogLevel;
 import jdk.jfr.internal.LogTag;
 import jdk.jfr.internal.Logger;
 import jdk.jfr.internal.Options;
+import jdk.jfr.internal.PlatformRecorder;
+import jdk.jfr.internal.PrivateAccess;
 import jdk.jfr.internal.Repository;
 import jdk.jfr.internal.SecuritySupport.SafePath;
 
@@ -89,6 +92,9 @@
                 SafePath s = new SafePath(repositoryPath);
                 Repository.getRepository().setBasePath(s);
                 Logger.log(LogTag.JFR, LogLevel.INFO, "Base repository path set to " + repositoryPath);
+                if (FlightRecorder.isInitialized()) {
+                    PrivateAccess.getInstance().getPlatformRecorder().rotateIfRecordingToDisk();;
+                }
             } catch (Exception e) {
                 throw new DCmdException("Could not use " + repositoryPath + " as repository. " + e.getMessage(), e);
             }