8236487: JFR Recorder Thread crashed due to "assert(_chunkwriter.is_valid()) failed: invariant"

Reviewed-by: mgronlun, mseledtsov
This commit is contained in:
Erik Gahlin 2020-01-08 19:12:20 +01:00
parent 89f2d14518
commit 0562caa4cb

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, 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
@ -671,7 +671,9 @@ void JfrRecorderService::invoke_flush() {
void JfrRecorderService::flushpoint() {
MutexLocker lock(JfrStream_lock, Mutex::_no_safepoint_check_flag);
invoke_flush();
if (_chunkwriter.is_valid()) {
invoke_flush();
}
}
void JfrRecorderService::process_full_buffers() {