kgyrtkirk commented on a change in pull request #1071:
URL: https://github.com/apache/hive/pull/1071#discussion_r439284688



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -13317,6 +13325,10 @@ public int markScheduledExecutionsTimedOut(int 
timeoutSecs) throws InvalidOperat
       recoverInvalidScheduledQueryState(timeoutSecs);
       committed = commitTransaction();
       return results.size();
+    } catch (InvalidOperationException | MetaException e) {
+      throw e;
+    } catch (Exception e) {
+      throw new MetaException(e.getMessage());

Review comment:
       I don't know what kind of IDE you are using; but mine(eclipse) and maven 
is perfectly fine with this:
   ```
     public static void main(String[] args) {
       try (aa x = new aa()) {
         System.out.println("body");
       } finally {
         System.out.println("final");
       }
     }
   
     static class aa implements AutoCloseable {
       public aa() {
         throw new RuntimeException();
       }
       @Override
       public void close() {
   
       }
     }
   
   ```
   note that `aa#close` doesn't throw `Exception` while `AutoCloseable#close` 
may.
   EDIT: however... `Query#close` is not overriden - only the `JDOQuery` 
implementation doesn't throw exception...so it will force the exception to be 
catched...
   
   I think then it would be better to go back to to the try-with-resources free 
version; the repackaging of the exceptions is one thing(which happens too much; 
and sometimes incorrectly around objectstore) - but now that try-with-resources 
is used the the "opentransaction" is also inside the try block - if the try 
fails the finally will still run; and may make the "counter" off by one... - 
the best would be to rewrite that as well to use try-with-resources but I'm 
aftraid that will be start a cascade of changes....it seems there is already 
some places which are using `openTransaction` in an interesting fashion...
   
   sorry for the detour; but its hard to make this part better..




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to