Skip to content

Commit

Permalink
8345493: JFR: JVM.flush hangs intermittently
Browse files Browse the repository at this point in the history
Reviewed-by: egahlin
Backport-of: 4257215
  • Loading branch information
Markus Grönlund committed Jan 15, 2025
1 parent c141aa1 commit 1495f7a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -679,4 +679,8 @@ public synchronized void migrate(SafePath repo) throws IOException {
public RepositoryChunk getCurrentChunk() {
return currentChunk;
}

public synchronized void flush() {
MetadataRepository.getInstance().flush();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2025, 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
Expand All @@ -26,6 +26,8 @@

import jdk.jfr.internal.JVM;
import jdk.jfr.internal.MetadataRepository;
import jdk.jfr.internal.PlatformRecorder;
import jdk.jfr.internal.PrivateAccess;
import jdk.jfr.internal.util.Utils;

/**
Expand All @@ -44,7 +46,8 @@ public FlushTask() {

@Override
public void execute(long timestamp, PeriodicType periodicType) {
MetadataRepository.getInstance().flush();
PlatformRecorder recorder = PrivateAccess.getInstance().getPlatformRecorder();
recorder.flush();
Utils.notifyFlush();
}

Expand Down

0 comments on commit 1495f7a

Please sign in to comment.