dlmarion commented on PR #5409: URL: https://github.com/apache/accumulo/pull/5409#issuecomment-2731015174
The code is checking the cause of the exception. IIRC the ZK exception is wrapped in a runtime exception. On Mon, Mar 17, 2025, 5:47 PM Christopher Tubbs ***@***.***> wrote: > ***@***.**** commented on this pull request. > ------------------------------ > > In > server/manager/src/main/java/org/apache/accumulo/manager/upgrade/Upgrader12to13.java > <https://github.com/apache/accumulo/pull/5409#discussion_r1999721285>: > > > } catch (Exception e) { > if (e.getCause() instanceof KeeperException.NodeExistsException) { > LOG.debug("Fate table node already exists in ZooKeeper"); > + } else { > + throw e; > } > > This change is looking for a very specific exception. There's no reason to > check it with instanceof. It should just use a regular catch block: > ⬇️ Suggested change > > - } catch (Exception e) { > - if (e.getCause() instanceof KeeperException.NodeExistsException) { > - LOG.debug("Fate table node already exists in ZooKeeper"); > - } else { > - throw e; > - } > + } catch (KeeperException.NodeExistsException e) { > + LOG.debug("Fate table node already exists in ZooKeeper"); > > — > Reply to this email directly, view it on GitHub > <https://github.com/apache/accumulo/pull/5409#pullrequestreview-2692166509>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAEKUZZNRYIIKADRMEVV7PL2U47FFAVCNFSM6AAAAABZGKMJYCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMOJSGE3DMNJQHE> > . > You are receiving this because you were assigned.Message ID: > ***@***.***> > -- 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]
