8307738: JFR: EventStream.openRepository() drops events
Reviewed-by: mgronlun
This commit is contained in:
parent
736b90d54b
commit
d10467e27b
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2023, 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
|
||||
@ -98,6 +98,7 @@ public final class ChunkParser {
|
||||
private ParserConfiguration configuration;
|
||||
private MetadataDescriptor previousMetadata;
|
||||
private MetadataDescriptor metadata;
|
||||
private long lastFlush;
|
||||
private boolean staleMetadata = true;
|
||||
|
||||
public ChunkParser(RecordingInput input, ParserState ps) throws IOException {
|
||||
@ -254,7 +255,7 @@ public final class ChunkParser {
|
||||
// Not accepted by filter
|
||||
} else {
|
||||
if (typeId == 1) { // checkpoint event
|
||||
if (CheckpointType.FLUSH.is(parseCheckpointType())) {
|
||||
if ((parseFlushCheckpoint())) {
|
||||
input.position(pos + size);
|
||||
return FLUSH_MARKER;
|
||||
}
|
||||
@ -269,11 +270,15 @@ public final class ChunkParser {
|
||||
return null;
|
||||
}
|
||||
|
||||
private byte parseCheckpointType() throws IOException {
|
||||
input.readLong(); // timestamp
|
||||
private boolean parseFlushCheckpoint() throws IOException {
|
||||
long timestamp = input.readLong();
|
||||
input.readLong(); // duration
|
||||
input.readLong(); // delta
|
||||
return input.readByte();
|
||||
if (CheckpointType.FLUSH.is(input.readByte())) {
|
||||
lastFlush = timeConverter.convertTimestamp(timestamp);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean awaitUpdatedHeader(long absoluteChunkEnd, long filterEnd) throws IOException {
|
||||
@ -482,6 +487,10 @@ public final class ChunkParser {
|
||||
return getStartNanos() + getChunkDuration();
|
||||
}
|
||||
|
||||
public long getLastFlush() {
|
||||
return lastFlush;
|
||||
}
|
||||
|
||||
public void setStaleMetadata(boolean stale) {
|
||||
this.staleMetadata = stale;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2023, 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
|
||||
@ -166,9 +166,7 @@ public final class EventDirectoryStream extends AbstractEventStream {
|
||||
processUnordered(disp);
|
||||
}
|
||||
currentParser.resetCache();
|
||||
long endNanos = currentParser.getStartNanos() + currentParser.getChunkDuration();
|
||||
// same conversion as in RecordingInfo
|
||||
if (endNanos > filterEnd) {
|
||||
if (currentParser.getLastFlush() > filterEnd) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user