[ 
https://issues.apache.org/jira/browse/CASSANDRA-7284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14005812#comment-14005812
 ] 

Sylvain Lebresne commented on CASSANDRA-7284:
---------------------------------------------

I would argue that an instanceof check is less future proof. If we end up 
passing a composite that is not empty and not a CellName in the future and we 
don't update that method, then an instanceof would just silence what would 
possibly be a bug, making it hard to track (sure, there is a chance a 
instanceof would be the right thing to do, but it might not be and I'm not a 
betting man). If we do change the code so a non empty composite can be passed 
to this method and this method is not updated, then getting a 
ClassCastException will make it very easy to track what's wrong and we can use 
the right fix.

But well, I would live with an instanceof, I just don't think it's better.

> ClassCastException in HintedHandoffManager.pagingFinished
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-7284
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7284
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Benedict
>            Assignee: Benedict
>            Priority: Minor
>             Fix For: 2.1 rc1
>
>         Attachments: 7284-v2.txt, 7284.txt
>
>
> During a long running stress test on bdplab, Ryan encountered the following 
> interesting exception, which I think is an as yet unfiled bug. Looks to be a 
> pretty simple issue, introduced by CASSANDRA-5417
> {code}
> java.lang.ClassCastException: 
> org.apache.cassandra.db.composites.Composites$EmptyComposite cannot be cast 
> to org.apache.cassandra.db.composites.CellName
>       at 
> org.apache.cassandra.db.HintedHandOffManager.pagingFinished(HintedHandOffManager.java:266)
>  ~[main/:na]
>       at 
> org.apache.cassandra.db.HintedHandOffManager.doDeliverHintsToEndpoint(HintedHandOffManager.java:376)
>  ~[main/:na]
>       at 
> org.apache.cassandra.db.HintedHandOffManager.deliverHintsToEndpoint(HintedHandOffManager.java:331)
>  ~[main/:na]
>       at 
> org.apache.cassandra.db.HintedHandOffManager.access$300(HintedHandOffManager.java:93)
>  ~[main/:na]
>       at 
> org.apache.cassandra.db.HintedHandOffManager$5.run(HintedHandOffManager.java:547)
>  ~[main/:na]
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>  ~[na:1.7.0_51]
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>  ~[na:1.7.0_51]
>       at java.lang.Thread.run(Thread.java:744) ~[na:1.7.0_51]
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to