Skip to content

Commit 999cef3

Browse files
committed
Tweaking handling of corrupt content in index-log.
1 parent a63fe88 commit 999cef3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/org/jenkinsci/plugins/workflow/log/FileLogStorage.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,13 @@ private final class IndexOutputStream extends OutputStream {
257257
try {
258258
lastTransition = Long.parseLong(space == -1 ? line : line.substring(0, space));
259259
} catch (NumberFormatException x) {
260+
LOGGER.warning("Ignoring corrupt index file " + index);
260261
// If index-log is corrupt for whatever reason, we given up on this step in this build;
261262
// there is no way we would be able to produce accurate output anyway.
262-
// Note that NumberFormatException is already logged separately for the overall build log,
263-
// which is in that case nonfatal: the whole-build HTML output always includes exactly what is in the main log file,
263+
// Note that NumberFormatException is nonfatal in the case of the overall build log:
264+
// the whole-build HTML output always includes exactly what is in the main log file,
264265
// at worst with some missing or inaccurate startStep/endStep annotations.
265-
break; // corrupt index file; forget it
266+
continue;
266267
}
267268
if (pos == -1) {
268269
if (space != -1 && line.substring(space + 1).equals(id)) {

0 commit comments

Comments
 (0)