hemantk-12 commented on code in PR #6171:
URL: https://github.com/apache/ozone/pull/6171#discussion_r1480488656


##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java:
##########
@@ -587,7 +587,7 @@ void addToCompactionLogTable(CompactionLogEntry 
compactionLogEntry) {
    * Check if there is any in_progress tarball creation request and wait till
    * all tarball creation finish, and it gets notified.
    */
-  private void waitForTarballCreation() {
+  private synchronized void waitForTarballCreation() {

Review Comment:
   `tarballRequestCount` is an `AtomicInteger` so the incrementing and 
decrementing it would be atomic.
   
   `waitForTarballCreation` is synchronized because wait/notify are supposed to 
be allowed on the same object's lock otherwise it throws 
`IllegalMonitorStateException`. Doc: 
[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--)/[notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--).
   
   More in discussion on jira: HDDS-9039 why we are adding the test this way.



-- 
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]

Reply via email to