Skip to content

Commit 51b3c7f

Browse files
committed
Improve parallel-update reject log thread safety
Fixed an issue in which parallel-update did not properly handle multiple concurrent attempts to write to the reject file, which could cause its contents to be unparseable or otherwise incorrect.
1 parent 68aa4ee commit 51b3c7f

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

docs/release-notes.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ <h3>Version 6.0.10</h3>
2424
<br><br>
2525
</li>
2626

27+
<li>
28+
Fixed an issue in which parallel-update did not properly handle multiple
29+
concurrent attempts to write to the reject file, which could cause its contents
30+
to be unparseable or otherwise incorrect.
31+
<br><br>
32+
</li>
33+
2734
<li>
2835
Updated the PLAINBindRequest class to add an encodeCredentials method that can be
2936
used to retrieve a properly encoded representation of the SASL credentials for a

src/com/unboundid/ldap/sdk/unboundidds/tools/ParallelUpdate.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,11 +2446,17 @@ void reject(@Nullable final LDIFChangeRecord changeRecord,
24462446
changeRecord.getChangeType().getName(), " REJECT ", resultCode, " ",
24472447
ldapException.getMessage());
24482448

2449-
rejectWriter.writeChangeRecord(changeRecord, comment);
2449+
synchronized (rejectWriter)
2450+
{
2451+
rejectWriter.writeChangeRecord(changeRecord, comment);
2452+
}
24502453
}
24512454
else
24522455
{
2453-
rejectWriter.writeComment(comment, true, true);
2456+
synchronized (rejectWriter)
2457+
{
2458+
rejectWriter.writeComment(comment, true, true);
2459+
}
24542460
}
24552461
}
24562462
catch (final Exception e)

0 commit comments

Comments
 (0)