Skip to content

Commit 580e318

Browse files
committed
Follow up to #24
ice insert: Fix race condition resulting from multiple threads using retryLog.add() without proper synchronization.
1 parent c1ce7aa commit 580e318

File tree

1 file changed

+3
-1
lines changed
  • ice/src/main/java/com/altinity/ice/cli/internal/retry

1 file changed

+3
-1
lines changed

ice/src/main/java/com/altinity/ice/cli/internal/retry/RetryLog.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ public RetryLog(String f) throws IOException {
2828
this.w = new BufferedWriter(new FileWriter(f + "~"));
2929
}
3030

31+
// This method is expected to be thread-safe.
3132
public void add(String fileToRetry) throws IOException {
32-
w.append(fileToRetry).write("\n");
33+
//noinspection StringConcatenationInsideStringBufferAppend
34+
w.append(fileToRetry + "\n");
3335
}
3436

3537
public void commit() throws IOException {

0 commit comments

Comments
 (0)