Skip to content

Commit

Permalink
[core] RollingFileWriter#abort shouldn't abort currentWriter twice
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzelin committed Nov 19, 2024
1 parent 220789d commit 672fc4d
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ public void write(T row) throws IOException {
openCurrentWriter();
}

currentWriter.write(row);
try {
currentWriter.write(row);
} catch (Throwable e) {
currentWriter = null;
throw e;
}
recordCount += 1;

if (rollingFile()) {
Expand All @@ -102,7 +107,12 @@ public void writeBundle(BundleRecords bundle) throws IOException {
openCurrentWriter();
}

currentWriter.writeBundle(bundle);
try {
currentWriter.writeBundle(bundle);
} catch (Throwable e) {
currentWriter = null;
throw e;
}
recordCount += bundle.rowCount();

if (rollingFile()) {
Expand Down

0 comments on commit 672fc4d

Please sign in to comment.