Skip to content

Commit

Permalink
Improve parallel-update reject log thread safety
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dirmgr committed Sep 12, 2023
1 parent 68aa4ee commit 51b3c7f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docs/release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ <h3>Version 6.0.10</h3>
<br><br>
</li>

<li>
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.
<br><br>
</li>

<li>
Updated the PLAINBindRequest class to add an encodeCredentials method that can be
used to retrieve a properly encoded representation of the SASL credentials for a
Expand Down
10 changes: 8 additions & 2 deletions src/com/unboundid/ldap/sdk/unboundidds/tools/ParallelUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -2446,11 +2446,17 @@ void reject(@Nullable final LDIFChangeRecord changeRecord,
changeRecord.getChangeType().getName(), " REJECT ", resultCode, " ",
ldapException.getMessage());

rejectWriter.writeChangeRecord(changeRecord, comment);
synchronized (rejectWriter)
{
rejectWriter.writeChangeRecord(changeRecord, comment);
}
}
else
{
rejectWriter.writeComment(comment, true, true);
synchronized (rejectWriter)
{
rejectWriter.writeComment(comment, true, true);
}
}
}
catch (final Exception e)
Expand Down

0 comments on commit 51b3c7f

Please sign in to comment.