Github user poornachandra commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/35#discussion_r100709949
  
    --- Diff: 
tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/txprune/PruneUpperBoundWriter.java
 ---
    @@ -81,14 +84,23 @@ private void startFlushThread() {
         flushThread = new Thread("tephra-prune-upper-bound-writer") {
           @Override
           public void run() {
    -        while ((!isInterrupted()) && isRunning()) {
    +        Service.State serviceState = state();
    +        while ((!isInterrupted()) &&
    +          (serviceState.equals(Service.State.NEW) || 
serviceState.equals(Service.State.STARTING) ||
    +            serviceState.equals(Service.State.RUNNING))) {
               long now = System.currentTimeMillis();
               if (now > (lastChecked + pruneFlushInterval)) {
                 // should flush data
                 try {
                   while (pruneEntries.firstEntry() != null) {
    -                Map.Entry<byte[], Long> firstEntry = 
pruneEntries.firstEntry();
    -                
dataJanitorState.savePruneUpperBoundForRegion(firstEntry.getKey(), 
firstEntry.getValue());
    +                final Map.Entry<byte[], Long> firstEntry = 
pruneEntries.firstEntry();
    +                User.runAsLoginUser(new PrivilegedExceptionAction<Void>() {
    --- End diff --
    
    Adding `User.runAsLoginUser` here brings in unnecessary security code into 
`PruneUpperBoundWriter` class. Also if we modify `TransactionProcessor` later 
to add other table operations, we may miss to wrap those calls. I think it 
would be better to do the wrapping in `TransactionProcessor` class itself. What 
do you say?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to