adoroszlai commented on code in PR #5543:
URL: https://github.com/apache/ozone/pull/5543#discussion_r1383507890
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/ContainerImporter.java:
##########
@@ -99,6 +123,9 @@ public void importContainer(long containerID, Path
tarFilePath,
containerSet.addContainer(container);
}
} finally {
+ synchronized (this) {
Review Comment:
We _can_ use `synchronizedSet`, because we can get rid of the `contains()`
call. `add()` returns `true` if the item was added successfully, i.e. was not
already present in the `Set`.
```
if (!importContainerProgress.add(containerID)) {
LOG...
throw...
}
```
In fact, we _should_ use `synchronizedSet`, since currently logging is
performed while holding the lock.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]