[ 
https://issues.apache.org/jira/browse/CASSANDRA-18623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brandon Williams updated CASSANDRA-18623:
-----------------------------------------
     Bug Category: Parent values: Correctness(12982)Level 1 values: API / 
Semantic Implementation(12988)
       Complexity: Normal
      Component/s: Legacy/Core
    Discovered By: User Report
    Fix Version/s: 5.x
         Severity: Normal
           Status: Open  (was: Triage Needed)

> The exceptions related to queryNames are inconsistently handled in 
> NodeProbe.java
> ---------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-18623
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18623
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Legacy/Core
>            Reporter: Hao Zhong
>            Priority: Normal
>             Fix For: 5.x
>
>
> The call of queryNames can cause MalformedObjectNameException and 
> IOException, but the exceptions are inconsistently handled. 
> The following method rethrows RuntimeException:
> {code:java}
>  private static Multimap<String, String> 
> getJmxThreadPools(MBeanServerConnection mbeanServerConn)
> {
>  try        
> {            
>    Multimap<String, String> threadPools = HashMultimap.create();
>    Set<ObjectName> threadPoolObjectNames = mbeanServerConn.queryNames(        
>             new 
> ObjectName("org.apache.cassandra.metrics:type=ThreadPools,*"),                
>     null);
>       ...
>   }catch (MalformedObjectNameException e) {
>           throw new RuntimeException("Bad query to JMX server: ", e);        
>   }catch (IOException e)        
> {         throw new RuntimeException("Error getting threadpool names from 
> JMX", e);        } 
>    {code}
> A method swallows the thrown exceptions:
> {code:java}
>  public ColumnFamilyStoreMBean getCfsProxy(String ks, String cf)
> {
>   ...
> try{
>      Set<ObjectName> beans = mbeanServerConn.queryNames(                    
> new ObjectName("org.apache.cassandra.db:type=*" + type +",keyspace=" + ks + 
> ",columnfamily=" + cf), null);
>      ...
> }catch (MalformedObjectNameException mone)        { 
>      System.err.println("ColumnFamilyStore for " + ks + "/" + cf + " not 
> found.");            System.exit(1);        
> }catch (IOException e){
>      System.err.println("ColumnFamilyStore for " + ks + "/" + cf + " not 
> found: " + e);            System.exit(1);        }
>    {code}
> A method does not handle it at all:
> {code:java}
> private List<Entry<String, ColumnFamilyStoreMBean>> 
> getCFSMBeans(MBeanServerConnection mbeanServerConn, String type)            
> throws MalformedObjectNameException, IOException
> {
>    ...
>     ObjectName query = new ObjectName("org.apache.cassandra.db:type=" + type 
> +",*");        Set<ObjectName> cfObjects = mbeanServerConn.queryNames(query, 
> null);
>   ...
> }
>     {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to