lfrancke commented on code in PR #2586:
URL: https://github.com/apache/phoenix/pull/2586#discussion_r3791356768


##########
phoenix-core-client/src/main/java/org/apache/phoenix/execute/MutationState.java:
##########
@@ -1660,6 +1668,12 @@ private IOException 
updateTableRegionCacheIfNecessary(IOException ioe) {
               
PhoenixKeyValueUtil.getEstimatedRowMutationSizeWithBatch(this.mutationsMap);
           }
           areAllBatchesSuccessful = true;
+        } catch (RuntimeException e) {
+          // A RuntimeException here is a Phoenix bug, not a failed mutation. 
Rethrow it rather
+          // than wrapping it in a CommitException, which would report it as a 
server-side commit
+          // failure. Checked exceptions from hTable.batch() still fall 
through to the handler
+          // below. This is the pattern SpotBugs REC_CATCH_EXCEPTION asks for.
+          throw e;
         } catch (Exception e) {

Review Comment:
   This was a decision I (human me, not AI) made. I don't know when/how this 
happened but anyway the existing code fails SpotBugs - maybe the rule was 
introduced after the code already existed? I don't know. But SpotBugs suggests 
exactly this pattern as a fix.
   
   I can revert it but then we'll need a SpotBugs exclusion for that line. 
Personally I think it makes sense to keep this in but I'll let you decide.



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

Reply via email to