adoroszlai commented on code in PR #6026:
URL: https://github.com/apache/ozone/pull/6026#discussion_r1457092171
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServlet.java:
##########
@@ -252,13 +252,10 @@ public DBCheckpoint getCheckpoint(Path tmpdir, boolean
flush)
checkpoint = getDbStore().getCheckpoint(flush);
} finally {
// Unpause the compaction threads.
- synchronized (getDbStore().getRocksDBCheckpointDiffer()) {
- differ.decrementTarballRequestCount();
- differ.notifyAll();
- long elapsedTime = System.currentTimeMillis() - startTime;
- LOG.info("Compaction pausing {} ended. Elapsed ms: {}",
- pauseCounter, elapsedTime);
- }
+ differ.decrementTarballRequestCount();
+ differ.notifyAll();
Review Comment:
`notifyAll()` needs the object lock (see
[docs](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--).
BTW it should be `synchronized (differ)`, which is both simpler and safer.
`differ.decrementTarballRequestCount()` may or may not need the lock, I
cannot comment on that.
`LOG.info` should be outside 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]