[email protected] has posted comments on this change. ( http://gerrit.cloudera.org:8080/16201 )
Change subject: KUDU-1422 resize ErrorCollector ...................................................................... Patch Set 3: (1 comment) http://gerrit.cloudera.org:8080/#/c/16201/2/java/kudu-client/src/main/java/org/apache/kudu/client/ErrorCollector.java File java/kudu-client/src/main/java/org/apache/kudu/client/ErrorCollector.java: http://gerrit.cloudera.org:8080/#/c/16201/2/java/kudu-client/src/main/java/org/apache/kudu/client/ErrorCollector.java@34 PS2, Line 34: private volatile int maxCapacity; > It's true that the constructor is not synchronized, but it doesn't have to Let's say thread A creates a ErrorCollector object E and passes E's reference to thread B. Then thread B calls addError method. The problem is even though addError is called after the constructor, thread B is not guaranteed to see the default value 1000, cause there is no happens-before link between A and B. But once resize() is called, A and B will see the same value cause all the methods are sychronised and they are synchronised on the same lock. -- To view, visit http://gerrit.cloudera.org:8080/16201 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I53731f6367aa84d6435b3bf2143e86164c8eaa1e Gerrit-Change-Number: 16201 Gerrit-PatchSet: 3 Gerrit-Owner: Anonymous Coward <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Anonymous Coward <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Grant Henke <[email protected]> Gerrit-Reviewer: Greg Solovyev <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Comment-Date: Thu, 16 Jul 2020 09:19:56 +0000 Gerrit-HasComments: Yes
