File tree Expand file tree Collapse file tree 5 files changed +15
-9
lines changed
src/jdk.jfr/share/classes/jdk/jfr/internal
api/consumer/recordingstream Expand file tree Collapse file tree 5 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -166,18 +166,21 @@ protected void processRecursionSafe() throws IOException {
166
166
processUnordered (disp );
167
167
}
168
168
currentParser .resetCache ();
169
- barrier .check (); // block if recording is being stopped
170
169
long endNanos = currentParser .getStartNanos () + currentParser .getChunkDuration ();
171
170
// same conversion as in RecordingInfo
172
- long endMillis = Instant .ofEpochSecond (0 , endNanos ).toEpochMilli ();
173
- if (barrier .getStreamEnd () <= endMillis ) {
174
- return ;
175
- }
176
171
if (endNanos > filterEnd ) {
177
172
return ;
178
173
}
179
174
}
180
- if (isLastChunk ()) {
175
+ long endNanos = currentParser .getStartNanos () + currentParser .getChunkDuration ();
176
+ long endMillis = Instant .ofEpochSecond (0 , endNanos ).toEpochMilli ();
177
+
178
+ barrier .check (); // block if recording is being stopped
179
+ if (barrier .getStreamEnd () <= endMillis ) {
180
+ return ;
181
+ }
182
+
183
+ if (!barrier .hasStreamEnd () && isLastChunk ()) {
181
184
// Recording was stopped/closed externally, and no more data to process.
182
185
return ;
183
186
}
Original file line number Diff line number Diff line change @@ -62,6 +62,10 @@ public synchronized long getStreamEnd() {
62
62
return end ;
63
63
}
64
64
65
+ public synchronized boolean hasStreamEnd () {
66
+ return end != Long .MAX_VALUE ;
67
+ }
68
+
65
69
public synchronized void activate () {
66
70
activated = true ;
67
71
}
Original file line number Diff line number Diff line change @@ -749,7 +749,6 @@ jdk/jfr/startupargs/TestStartDuration.java 8214685 windows-
749
749
jdk/jfr/jvm/TestWaste.java 8282427 generic-all
750
750
jdk/jfr/api/consumer/recordingstream/TestOnEvent.java 8255404 linux-x64
751
751
jdk/jfr/api/consumer/TestRecordingFileWrite.java 8287699 generic-all
752
- jdk/jfr/api/consumer/recordingstream/TestStop.java 8298043 generic-all
753
752
754
753
############################################################################
755
754
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ private static void testNestedStop() throws Exception {
149
149
if (dumpOuter .size () != 3 ) {
150
150
throw new AssertionError ("Expected outer dump to have 3 events" );
151
151
}
152
- if (outerCount .get () = = 3 ) {
152
+ if (outerCount .get () ! = 3 ) {
153
153
throw new AssertionError ("Expected outer stream to have 3 events" );
154
154
}
155
155
if (dumpInner .size () != 1 ) {
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ private static void testNestedStop() throws Exception {
158
158
if (dumpOuter .size () != 3 ) {
159
159
throw new AssertionError ("Expected outer dump to have 3 events" );
160
160
}
161
- if (outerCount .get () = = 3 ) {
161
+ if (outerCount .get () ! = 3 ) {
162
162
throw new AssertionError ("Expected outer stream to have 3 events" );
163
163
}
164
164
if (dumpInner .size () != 1 ) {
You can’t perform that action at this time.
0 commit comments