accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [accumulo] keith-turner commented on a change in pull request #1032: fixes #1031 fix concurrency bug and remove unused code
Date Thu, 14 Mar 2019 16:55:54 GMT
keith-turner 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_r265668907
 
 

 ##########
 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:
   I don't think sync is required for isClosing().   I thought about changing it but it is
part of a family of methods for checking state, and if its changed then all should be changed.
 One of the methods in that family reads closeState twice, so it would need a slight refactoring
(read into a local var once) if it were not synchronized.  I mulled over making that change
and decided not to.  I didn't want to make too much of a change for 1.9.  If I were to make
a larger change would you be able to give it a thorough review?

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

Mime
View raw message