File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/main/java/org/jenkinsci/plugins/workflow/log Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ private final class IndexOutputStream extends OutputStream {
268268 if (space != -1 && line .substring (space + 1 ).equals (id )) {
269269 pos = lastTransition ;
270270 }
271- } else {
271+ } else if ( lastTransition > pos ) {
272272 raf .seek (pos );
273273 if (lastTransition > pos + Integer .MAX_VALUE ) {
274274 throw new IOException ("Cannot read more than 2Gib at a time" ); // ByteBuffer does not support it anyway
@@ -287,9 +287,9 @@ private final class IndexOutputStream extends OutputStream {
287287 raf .readFully (data );
288288 buf .write (data );
289289 pos = -1 ;
290- }
290+ } // else some sort of mismatch
291291 }
292- if (pos != -1 ) {
292+ if (pos != -1 && /* otherwise race condition? */ end > pos ) {
293293 // In case the build is ongoing and we are still actively writing content for this step,
294294 // we will hit EOF before any other transition. Otherwise identical to normal case above.
295295 raf .seek (pos );
You can’t perform that action at this time.
0 commit comments