You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/03/13 21:31:01 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #1032: fixes #1031 fix concurrency bug and remove unused code

ctubbsii commented on a change in pull request #1032: fixes #1031 fix concurrency bug and remove unused code
URL: https://github.com/apache/accumulo/pull/1032#discussion_r265339750
 
 

 ##########
 File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
 ##########
 @@ -1989,7 +1985,9 @@ private CompactionStats _majorCompact(MajorCompactionReason reason)
           CompactionEnv cenv = new CompactionEnv() {
             @Override
             public boolean isCompactionEnabled() {
-              return Tablet.this.isCompactionEnabled();
+              // avoid calling isClosing() because its synchronized and this is called frequently in
+              // compaction
+              return closeState != CloseState.CLOSING;
 
 Review comment:
   The comment helps a little, but I'm still confused why synchronization isn't required here, but is for all the callers of `isClosing()` (which effectively has an identical implementation).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services